daily pastebin goal
67%
SHARE
TWEET

Untitled

a guest Mar 8th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. public class Dog{
  3.  
  4.    private int age = 0;
  5.    private String name;
  6.  
  7. /*   public Dog(String name, int age) {
  8.       name = name;
  9.       age = age;
  10.     }*/
  11.  
  12.    public String getName(){
  13.       return this.name;
  14.     }
  15.  
  16.    public void setName(String NEWname){
  17.       this.name = NEWname;
  18.     }
  19.  
  20.     public int getAge(){
  21.       return this.age;
  22.     }
  23.  
  24.    public void setAge(int NEWage){
  25.       this.age = NEWage;
  26.     }
  27.  
  28.    public  int humanYears(){
  29.       return age * 7;
  30.     }
  31.  
  32.    public String toString(){
  33.       String str = "Dog name is: " + name + " Dog's age is: " + age;
  34.       return str;
  35.    }
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top