-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDictionary.java
More file actions
57 lines (41 loc) · 1.13 KB
/
Dictionary.java
File metadata and controls
57 lines (41 loc) · 1.13 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
package src.oopJava;
/*
Author: Spyros Tsioupros
Year: 2021
1st year university project
*/
//class that spesializes book objects
public class Dictionary extends Book{
//attributes
private int dictEntries;
//constructors
public Dictionary(){}
public Dictionary(String ISBN){
super(ISBN);
}
public Dictionary(int dictEntries, String title, String fullName, String ISBN, String publisher, int pages, int publYear, double price){
super(title, fullName, ISBN, publisher, pages, publYear, price);
this.dictEntries = dictEntries;
}
public Dictionary(String ISBN, int dictEntries){
super(ISBN);
this.dictEntries = dictEntries;
}
//get@ methods
public int getDictEntries(){
return dictEntries;
}
@Override
public String getBookCategory(){
return "Dictionary";
}
//set@ method
public void setDictEntries(int dictEntries){
this.dictEntries = dictEntries;
}
//toString method
@Override
public String toString(){
return super.toString() + ", Word Count: " + dictEntries;
}
}