PPT Slide
class Dog extends Animal {
public Dog() {
super.strNoise = “Woof”;
} // of constructor
public void doYourThing ( ) {
super.identifySelf();
System.out.println(“I am a dog”);
System.out.println(strNoise);
} // of doYourThing
} // of Dog
Same (in this case) as
strNoise = “Woof”;
and
this.strNoise = “Woof”;
Same (in this case) as
identifySelf();
or
this.identifySelf();
Previous slide
Next slide
Back to first slide
View graphic version