An overriding method's return type
- Acheck_circle
Can be a subtype (covariant returns)
- B
Must be exactly the same
- C
Must be different
- D
Must be void
Explanation
Java permits covariant return types.
AP Computer Science A· difficulty 4/5
An overriding method's return type
Can be a subtype (covariant returns)
Must be exactly the same
Must be different
Must be void
Explanation
Java permits covariant return types.
Want 10 more like this — adaptive to your weak spots?
What occurs?…
chevron_rightA correctly overridden <codeequals</code should also have…
chevron_right<codeclass A { public String name() { return "A"; } } class B extends A { public String name() { return "B"; } } A obj = new B(); System.out.println(obj.name())…
chevron_right