public class LibraryMember { private int ssn; private Book book; /** * Creates a library member given his/her ssn * * @param ssn * the social security number of the library member */ public LibraryMember(int ssn) { this.ssn = ssn; } /** * Borrows a book from the library given its title * * @param title * the title of the book to borrow * @return true if the operation was successful, and false if not. */ public boolean borrowBook(String title) { if (book == null) { book = new Book(title); System.out.println("The book titled " + title + " has been checked out."); return true; } else { System.out .println("You can't borrow another book.\nYou already have one"); return false; } } /** * Returns the book (if any) to the library * * @return true if the operation was successful, and false if not. */ public boolean returnBook() { if (book != null) { System.out.println("The book titled " + book.getTitle() + " has been returned."); book = null; return true; } else { System.out.println("There is no book to return."); return false; } } }