-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.java
More file actions
34 lines (25 loc) · 719 Bytes
/
Book.java
File metadata and controls
34 lines (25 loc) · 719 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
public class Book {
public String title;
public String author;
private String isbn;
int copiesAvailable; // Default
// constructor to initialize all attributes
public Book(String title, String author, String isbn, int copiesAvailable) {
this.title = title;
this.author = author;
this.isbn = isbn;
this.copiesAvailable = copiesAvailable;
}
//Getter for ISBN
public String getIsbn() {
return isbn;
}
// Setter for copiesAvailable
public void setCopiesAvailable(int copies) {
this.copiesAvailable = copies;
}
//Getter for copiesAvailable
int getCopiesAvailable() {
return copiesAvailable;
}
}