Skip to content
Snippets Groups Projects

refactor 3

Merged Devon HARSTROM requested to merge refactor_2 into refactor_3
36 files
+ 901
190
Compare changes
  • Side-by-side
  • Inline
Files
36
package LibraryManagement;
public class Book {
private String title;
private String author;
private boolean loaned;
public Book(String title, String author) {
this.title = title;
this.author = author;
this.loaned = false;
}
public boolean isLoaned() {
return loaned;
}
public void setLoaned(boolean loaned) {
this.loaned = loaned;
}
// Getters and setters
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
Book book = (Book) obj;
return title.equals(book.title) && author.equals(book.author);
}
}
\ No newline at end of file
Loading