Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. public class Book {
  2.  
  3.     private String author;
  4.     private String title;
  5.     private String refNumber;
  6.     private int pages;
  7.    
  8.     public Book(String bookAuthor, String bookTitle, String bookRefNumber, int bookPages) {
  9.         author = bookAuthor;
  10.         title = bookTitle;
  11.         pages = bookPages;
  12.         refNumber = "";
  13.     }
  14.    
  15.     public String getAuthor() {
  16.         return author;
  17.     }
  18.     public String getTitle() {
  19.         return title;
  20.     }
  21.    
  22.     public int getPages() {
  23.         return pages;
  24.     }
  25.    
  26.     public String getRefNumber() {
  27.         return refNumber;
  28.     }
  29.    
  30.     public void setRefNumber(String refNumber) {
  31.         this.refNumber = refNumber;    
  32.     }
  33.    
  34.     public void printAuthor() {
  35.         System.out.println(author);
  36.     }
  37.    
  38.     public void printTitle() {
  39.         System.out.println(title);
  40.     }
  41.    
  42.     public void printDetails() {
  43.         System.out.println("Title: " + title + ", Author: " + author + ", Pages: " + pages);
  44.     }
  45. }