-
-
Save technoAl/a16fc1b2636e503a38d08005610600b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Book { | |
private String name; | |
private String author; | |
private int publishingDate; | |
private int age; | |
public Book(String name, String author, int publishingDate, int age){ | |
this.name = name; | |
this.author = author; | |
this.publishingDate = publishingDate; | |
this.age = age; | |
} | |
public void printBook(){ | |
System.out.println(name + " by " + author); | |
} | |
public void increaseAge(){ | |
age++; | |
} | |
public String getName() { | |
return name; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
public String getAuthor() { | |
return author; | |
} | |
public void setAuthor(String author) { | |
this.author = author; | |
} | |
public int getPublishingDate() { | |
return publishingDate; | |
} | |
public void setPublishingDate(int publishingDate) { | |
this.publishingDate = publishingDate; | |
} | |
public int getAge() { | |
return age; | |
} | |
public void setAge(int age) { | |
this.age = age; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment