binibiningtinamoran

BookTester

Nov 16th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. public class BookTester {
  2.  
  3.     public static void main(String[] args) {
  4.  
  5.         Book book1 = new Book("Harry Potter and the Goblet of Fire", "J.K. Rowling","1234568901",
  6.                 650,35,24.95);
  7.         DigitalBook db1 = new DigitalBook("The Fellowship of the Ring", "J.R.R. Tolkien",
  8.                 "9090909090", "PDF",425,40,19.95);
  9.  
  10.         System.out.println(book1.toString());
  11.  
  12.         System.out.println(db1.toString());
  13.         System.out.printf("Format of %s: %s\n", db1.getTitle(), db1.getFormat());
  14.  
  15.     }
  16. }
Add Comment
Please, Sign In to add comment