JohnJuntMockExam... What class must an inner class extend: a.The top level class b.The Object class c.Any class or interface d.It must extend an interface Select the most appropriate answer. my answer is b,but the answer is c ??? can somebody tell me why ??? the answer is wrong ?? liao
my answer is b,but the answer is c ??? can somebody tell me why ???
The question was: "What class must an inner class extend." An inner class is not forced to extend Object. Also, an inner class need not extend the enclosing class, nor an interface (though it can, if wants to).
chao-long liao
Ranch Hand
Joined: Jul 29, 2001
Posts: 78
posted
0
The question was: "What class must an inner class extend." An inner class is not forced to extend Object. Also, an inner class need not extend the enclosing class, nor an interface (though it can, if wants to).
Thanks,I can get what you say,but how about c, inner class "must" extend any class or interface?? So we can say it's not a good question,right ? It's ambiguous.
I guess the question expects the answer about anonymous inner class where it must extend a class or implememt an interface(though it is not mentioned there). [ June 20, 2002: Message edited by: Thiru Thangavelu ]