Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What class must an inner class extend

 
Richard Yi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all friends! I'm a freshman for this forum and this is my first post.
Below question's ans is 3, but I think it should be 2. Could you pls help me and give me the explanation! Many thans!
What class must an inner class extend:
Mutiple:
1) The top level class
2) The Object class
3) Any class or interface
4) It must extend an interface
 
Ray Stojonic
Ranch Hand
Posts: 326
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Answer 2 would restrict inner classes to extending only the Object class, Answer 3, on the other hand, includes the Object class in its 'any class or interface' statement.
 
Richard Yi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mn~~~ Ray, I think the question is "MUST extend", NOT "could extend" . An inner class could extend any classes and interfaces of course.
[ February 04, 2004: Message edited by: Richard Yi ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic