-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.java
More file actions
45 lines (36 loc) · 927 Bytes
/
Book.java
File metadata and controls
45 lines (36 loc) · 927 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
45
package lib;
class Book {
private String title;
private String author;
private double price;
private int stock;
private boolean discontinued;
public Book(String title, String author, double price, int stock) {
this.title = title;
this.author = author;
this.price = price;
this.stock = stock;
this.discontinued = false;
}
public String getTitle() {
return title;
}
public String getAuthor() {
return author;
}
public double getPrice() {
return price;
}
public int getStock() {
return stock;
}
public boolean isDiscontinued() {
return discontinued;
}
public void setStock(int stock) {
this.stock = stock;
}
public void setDiscontinued(boolean discontinued) {
this.discontinued = discontinued;
}
}