PPT Slide
Subclasses
(Cat extends Animal
i.e. “A cat is an animal” or
“All cats are animals”)
class Cat extends Animal {
public Cat() {
strNoise = “Miaow”;
} // of constructor
public void doYourThing ( ) {
identifySelf();
System.out.println(“I am a cat”);
System.out.println(strNoise);
} // of doYourThing
} // of Cat
Previous slide
Next slide
Back to first slide
View graphic version