-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.java
More file actions
44 lines (33 loc) · 853 Bytes
/
Copy pathBook.java
File metadata and controls
44 lines (33 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
public class Book {
private String title;
private String author;
public String getIsbn() {
return isbn;
}
public void setIsbn(String isbn) {
this.isbn = isbn;
}
private String isbn;
private String genre;
private boolean isBorrowed;
public Book(String title, String author, String isbn, String genre) {
this.title = title;
this.author = author;
this.isbn = isbn;
this.genre = genre;
this.isBorrowed = false;
}
public String getTitle() {
return title;
}
public void setBorrowed(boolean borrowed) {
isBorrowed = borrowed;
}
public boolean isBorrowed() {
return isBorrowed;
}
@Override
public String toString() {
return title + " by " + author + " (ISBN: " + isbn + ")";
}
}