Kizspy | Question: 29
(Choose 1 answer)
Consider a superclass with a private method and a subclass that attempts to override it. What happens in
terms of method overriding and access control?
A. The subclass can successfully override the private method.
B. The private method cannot be overridden in the subclass.
C. The subclass can override the private method, but only if it is declared as "protected" in the superclass.
D. The subclass can override the private method, but only if it is declared as "public" in the superclass.
E. The subclass can override the private method, but only if it is declared as "static" in the superclass.
F. The access modifier of the superclass method has no impact on method overriding.