Advertisement
wingman007

Java2014OOP_Dog

Dec 6th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6.  
  7. package zoo;
  8.  
  9. /**
  10.  *
  11.  * @author fmi
  12.  */
  13. public class Dog extends Animal{
  14.  
  15.     public Dog(String name) {
  16.         super(name);
  17.     }  
  18.    
  19.     @Override
  20.     public void makeNoise() {
  21.         super.makeNoise();
  22.         System.out.println("I am a dog. My name is " + getName() +" woof");
  23.    }
  24.    
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement