Java | Inheritance | Question 9
Predict the output of following program. Note that foo() is public in base and private in derived.
(C) Compiler Error
(D) Runtime Error
Explanation: It is compiler error to give more restrictive access to a derived class function which overrides a base class function.
Quiz of this Question