Advertisement
Guest User

Dog Class Code

a guest
Jan 27th, 2015
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1.  
  2. //January 23, 2015
  3. public class Dog{
  4.  private String Bark, EyeColor, FurColor; //instance variables
  5.  private int Age;
  6.  public Dog(){ //contructor, builds the dog itself
  7.      Bark = "Woof";
  8.      FurColor = "Tannish Brown";
  9.      EyeColor = "Brown";
  10.      Age = 1;
  11.     }
  12.  public Dog(String DogBark, String DogFurColor, String DogEyeColor, int DogAge){
  13.     Bark = DogBark;  //Contructor that allows us to specify the attributes of the Dog object
  14.     FurColor = DogFurColor;
  15.     EyeColor = DogEyeColor;
  16.     Age = DogAge;
  17.     }
  18.  
  19.  public String Bark(){
  20.     return Bark;
  21.     }
  22.  public void SetAge(int DogAge){
  23.      Age = DogAge;
  24.     }
  25.  public int GetAge(){
  26.      return Age;
  27.     }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement