posted 15 years ago
This Question is from Whizlabs practice exam
Given the following two classes,which statement true ?
The answers are:-
[A] The code will compile and run if line 8 is removed.
[B] The code will compile and run if line 9 is removed.
[C] The codecompiles and runs ,printing "Test" twice.
[D] The code compiles but throws exception at runtime.
The answer is given that the option B is correct.
In K&B book it is mentioned that protected members can only be accessible
by sub classes from diffrent package only through inheritance.
is the question is correct !!!