Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Book {
- private String author;
- private String title;
- private Genre genre;
- public Book() {
- author ="";
- title = "";
- genre = null;
- }
- public Book(String author, Genre genre, String title) {
- this.author = author;
- this.genre = genre;
- this.title = title;
- }
- public String getAuthor() {
- return author;
- }
- public void setAuthor(String author) {
- this.author = author;
- }
- public Genre getGenre() {
- return genre;
- }
- public void setGenre(Genre genre) {
- this.genre = genre;
- }
- public String getTitle() {
- return title;
- }
- public void setTitle(String title) {
- this.title = title;
- }
- public static void printBook(Book book){
- System.out.println(book.author + " " + book.title + " " + book.genre);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement