Properties of Method Overriding
All of the following statements about method overriding are true except:
public class Parent {
public String greet() {
return "Hello";
}
}
public class Child extends Parent {
@Override
public String greet() {
return "Hi";
}
}
A
An overridden method in the subclass must have the exact same name and parameter list as the method in the superclass.
B
Overriding a method in a subclass can be achieved by simply changing the method’s parameter list.
C
The @Override annotation helps catch errors in the method signature when overriding.
D
Method overriding enables polymorphism by allowing the subclass to provide a specialized implementation.
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE