posted 18 years ago
Hi,
This is a question from K&B book:
Given the following,
which statement is true?
A. The code compiles and runs, with output this 420 parent 420.
B. If line 8 is removed, the code will compile and run.
C. If line 10 is removed, the code will compile and run.
D. Both lines 8 and 10 must be removed for the code to compile.
E. An exception is thrown at runtime.
Answer given: C
I didn't understand the fact that p in line 10 cannot invoke its doStuff() method.
Thank you.
(formatted code)
[ August 07, 2005: Message edited by: Barry Gaunt ]
[ August 07, 2005: Message edited by: Adil El mouden ]
SCWCD 1.4(Loading...), SCJP 1.4(98%), Bachelor of Engineering (computer science)