Kwwiker

Animal

Aug 21st, 2020
126
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Animal {
  2.     private String name;
  3.     private int age;
  4.  
  5.     public Animal(String name, int age) {
  6.         this.name = name;
  7.         this.age = age;
  8.     }
  9.  
  10.     public void setName(String name) {
  11.         this.name = name;
  12.     }
  13.  
  14.     public String getName() {
  15.         return name;
  16.     }
  17.  
  18.     public int getAge() {
  19.         return age;
  20.     }
  21.  
  22.     public void getSong() {
  23.         System.out.println("Aaaa");
  24.     }
  25.  
  26. }
  27.  
RAW Paste Data