-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathBook.java
More file actions
38 lines (31 loc) · 915 Bytes
/
Copy pathBook.java
File metadata and controls
38 lines (31 loc) · 915 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
public class Book {
private String author;
private String title;
private String genre;
private int numPages;
public Book(String author, String title, String genre, int numPages) {
this.author = author;
this.title = title;
this.genre = genre;
this.numPages = numPages;
}//end ctor
public String getAuthor() {
return author;
}
public String getTitle() {
return title;
}
public String getGenre() {
return genre;
}
public int getNumPages() {
return numPages;
}
public void printBookDetails() {
System.out.println(title);
System.out.println("by " + author);
System.out.println("has " + numPages +
" pages, and its genre is " + genre);
System.out.println();
}//end printBookDetails
}//end Book class