-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEbook.java
More file actions
28 lines (22 loc) · 693 Bytes
/
Ebook.java
File metadata and controls
28 lines (22 loc) · 693 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
public class Ebook extends Book {
private String format;
Ebook(String title, String author, int pageCount, int price, String format) {
super(title, author, pageCount, price);
this.format = format;
}
// inherit method -> and use for overload(polymorphism)
public void generalInfo() {
System.out.println("This is an ebook");
}
public void generalInfo(int publishedTime) {
for (int i = 0; i < publishedTime; i++) {
System.out.println("This is an ebook");
}
}
public String getFormat() {
return this.format;
}
public void setFormat(String format) {
this.format = format;
}
}