Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: ookhai on Jul 1st, 2012  |  syntax: None  |  size: 0.56 KB  |  views: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //book clas
  2. public class Books {
  3.  
  4.     // data members
  5.         private String booksName;
  6.         private String booksAuthor;
  7.     private String booksEdition;
  8.     private int rackNo;
  9.  
  10.         // constructor
  11.         public Books(String booksName, String booksAuthor, String booksEdition, int rackNo) {
  12.                 this.booksName = booksName;
  13.                 this.booksAuthor = booksAuthor;
  14.                 this.booksEdition = booksEdition;
  15.                 this.rackNo = rackNo;
  16.         }
  17.         // toString method
  18.         public String toString() {
  19.                 return String.format("\t%-10s %-10s %-10s \t\t%d", booksName, booksAuthor, booksEdition, rackNo);
  20.         }
  21.        
  22.        
  23. }