-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathBookDemo.java
More file actions
26 lines (21 loc) · 916 Bytes
/
Copy pathBookDemo.java
File metadata and controls
26 lines (21 loc) · 916 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
public class BookDemo {
public static void main(String[] args) {
Book gameOfThrones = new Book("George Martin",
"Game of Thrones", "Fantasy", 864);
Book mathBook = new Book("James Stewart",
"Calculus", "Math", 1392);
Book javaBook = new Book("Joel Murach",
"Murach's Java Programming", "Programming", 800);
gameOfThrones.printBookDetails();
mathBook.printBookDetails();
javaBook.printBookDetails();
}//end main
// public static void printBookDetails(Book book) {
// System.out.println(book.getTitle());
// System.out.println("by " + book.getAuthor());
// System.out.println("has " + book.getNumPages() +
// " pages, and its genre is " + book.getGenre());
//
// System.out.println();
// }//end printBookDetails
}//end BookDemo class