-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatabase.java
More file actions
45 lines (32 loc) · 871 Bytes
/
Database.java
File metadata and controls
45 lines (32 loc) · 871 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 dome;
import java.util.ArrayList;
public class Database {
// public ArrayList<CD> listCD = new ArrayList <CD>();
// public ArrayList<DVD> listDVD = new ArrayList <DVD>();
public ArrayList<ITEM> listITEM = new ArrayList <ITEM>();
public void add(ITEM item){
listITEM.add(item);
}
public void list(){
for (ITEM item: listITEM){
item.print();
}
}
public static void main(String[] args){
Object o = new Object();
// o.toString();
Database db = new Database();
ITEM cd = new CD("abc","def",4,60,"good");
ITEM cc = new CD("abc","def",4,60,"good");
System.out.println(cd.equals(cc));
// System.out.println(cd);
// db.add(cd);
//
// ITEM dvd = new DVD("ABC","DEF",100,"bad");
// db.add(dvd);
// ITEM game = new Game("i","ii",70,"iii");
// db.add(game);
//
// db.list();
}
}