Advertisement
ookhai

Untitled

Jul 1st, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement