Advertisement
wingman007

Java2014OOP_Cat

Dec 6th, 2014
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 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 Cat extends Animal{
  14.  
  15.     public Cat(String name) {
  16.         super(name);
  17.     }  
  18.    
  19.     @Override
  20.     public void makeNoise() {
  21.         super.makeNoise();
  22.         System.out.println("I am a cat. My name is " + getName() + " meow");
  23.     }
  24.    
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement