Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Book {
- private String title, author;
- private int pages;
- private boolean referenceBook;
- public Book(String title, String author, int pages, boolean referenceBook) {
- this.title = title;
- this.author = author;
- this.pages = pages;
- this.referenceBook = referenceBook;
- }
- public Book(boolean referenceBook, int pages, String author, String title) {
- this.referenceBook = referenceBook;
- this.pages = pages;
- this.author = author;
- this.title = title;
- }
- public void printBookInfo() {
- System.out.println("Book Title: " + title);
- System.out.println("Book Author: " + author);
- System.out.println("Number of Pages: " + pages);
- System.out.println("Reference Book: " + referenceBook);
- System.out.println("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment