The simplified UML diagram above shows the relationships among
Java classes Bird, Crow, and Duck.
Suppose Bird has a fly(Location place) method, but we want Crows to
makeNoise() just before they take off and then behave like other
Birds. Assuming Crows have a makeNoise() method, we should
public void fly(Location place) {
this.makeNoise();
super.fly(place);
}
public void fly(Location place) {
this.makeNoise();
//[paste the body of Bird's fly method here]
}
public void fly(Location place) {
this.makeNoise();
}
public void fly(Location place) {
this.makeNoise();
this.fly(place);
}
public void fly(Location place) {
this.makeNoise();
Bird.fly(place);
}There are no hints for this question