| preferred AP College board partner for AP classes
AP Computer Science A/Unit 9: Inheritance
Start Practice TestPractice Test
About Exam
easy
Properties of Method Overriding
< Prev
Next >

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.

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: [email protected]|Privacy Policy