Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package University;
- public class Human {
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public int getAge() {
- return age;
- }
- public void setAge(int age) {
- this.age = age;
- }
- private String name = "Dima";
- private int age = 25;
- public void greeting() {
- System.out.println("Hi! I am a human");
- }
- public void howOldYou() {
- System.out.println("I am "+ this.getAge() + " years old");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement