-
Notifications
You must be signed in to change notification settings - Fork 0
/
LibraryBook.java
43 lines (32 loc) · 994 Bytes
/
LibraryBook.java
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
public class LibraryBook extends Book {
String subject;
String callNumber;
public void setSubject (String subject) {
this.subject = subject;
}
public void setCallNumber(String subject, String floorNumber, String author, String isbn) {
this.callNumber = subject + '.' + floorNumber + '.' + author + '.' + isbn;
}
public String getCallNumber() {
return callNumber;
}
public String getSubject() {
return subject;
}
public LibraryBook(String title, String author, String isbn, String subject, String callNumber) {
super(title, author, isbn);
this.subject = subject;
this.callNumber = callNumber;
}
public LibraryBook(String title, String author, String isbn) {
super(title, author, isbn);
}
@Override
public String getBookType() {
return "Library Book";
}
@Override
public String toString() {
return super.toString() + "-" + callNumber.toUpperCase() + "]";
}
}