PPT Slide
Using super
class Dog extends Animal {
// constructor as before
public void doYourThing() {
identifySelf();
System.out.println(strNoise);
} // of doYourThing
public void identifySelf() {
super.identifySelf();
System.out.println(“I am a dog”);
} // of identifySelf
} // of Dog
I.e. the
identifySelf()
(defined in Animal)
Previous slide
Next slide
Back to first slide
View graphic version