Pop Quiz
public class Book {
String title;
double uniqueid;
int bookcount;
int number;
public Book(String title) {
this.title = title;
}
public String toString() {
return ("the title is" + title + "the unique id is" + uniqueid + "the bookcount is" + bookcount);
}
public String gettitle() {
return title;
}
public void generateuniqueid() {
// uniqueid = Math.random() * 1000;
uniqueid = System.currentTimeMillis() + Math.random();
}
public double getuniqueid() {
return uniqueid;
}
public int getbookcount() {
return bookcount;
}
public static void main(String[] args) {
Book test = new Book("test");
test.generateuniqueid();
System.out.println(test.getuniqueid());
System.out.println(test.getbookcount());
System.out.println(test.gettitle());
Book test2 = new Book("Harry Potter");
test2.generateuniqueid();
System.out.println(test2.getuniqueid());
System.out.println(test2.getbookcount());
System.out.println(test2.gettitle());
}
}
Book.main(null);