Write a test program that creates some items of different types, adds them to the database, removes one of them and then prints out a list
public class Main {
public static void main(String[] args) {
Database database = new Database();
database.addItem(new CD("Night","Good",25.2,"Tarja",20));
database.addItem(new CD("Twenty","Nice",20,"Tom",10));
database.addItem(new DVD("Ram","Excellent",300.5,"Till",18));
database.addItem(new DVD("Holly","Good",15.5,"Charlie",21));
database.printList();
database.removeItem("LOUNA");
System.out.println();
database.printList();
database.depreciateItems();
System.out.println();
database.printList();
}
}
Comments
Leave a comment