-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.java
More file actions
27 lines (23 loc) · 716 Bytes
/
Book.java
File metadata and controls
27 lines (23 loc) · 716 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
public class Book {
private int id;
private String title;
private String author;
private boolean isIssued;
public Book(int id, String title, String author) {
this.id = id;
this.title = title;
this.author = author;
this.isIssued = false;
}
public int getId() { return id; }
public String getTitle() { return title; }
public String getAuthor() { return author; }
public boolean isIssued() { return isIssued; }
public void setIssued(boolean issued) {
this.isIssued = issued;
}
@Override
public String toString() {
return id + " | " + title + " | " + author + " | " + (isIssued ? "Issued" : "Available");
}
}