You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class PolymorphismOverridingExample extends Penguin {
public int getHeight() { return 8; }
public void printThis() {
super.printInfo(); // Prints 8 - because the object is a PolymorphismExample and the method getHeight has been overridden to return 8
this.printInfo(); // Prints 3 - because printInfo has been overridden on PolymorphismExample and it calls super.getHeight (3) and not the this.getHeight (8)