Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Reader {
- public String name;
- public int age;
- public int booksRead;
- public Reader(String name, int age, int booksRead){
- this.name = name;
- this.age = age;
- this.booksRead = booksRead;
- }
- public int addBooks(int count){
- return booksRead += count;
- }
- public void displayReader(){
- System.out.println("The name of the reader is : " + name);
- System.out.println("The age of the reader is : " + age);
- System.out.println("The books the reader have read are : " + booksRead);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement