Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //book clas
- public class Books {
- // data members
- private String booksName;
- private String booksAuthor;
- private String booksEdition;
- private int rackNo;
- // constructor
- public Books(String booksName, String booksAuthor, String booksEdition, int rackNo) {
- this.booksName = booksName;
- this.booksAuthor = booksAuthor;
- this.booksEdition = booksEdition;
- this.rackNo = rackNo;
- }
- // toString method
- public String toString() {
- return String.format("\t%-10s %-10s %-10s \t\t%d", booksName, booksAuthor, booksEdition, rackNo);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement