This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

inner class  RSS feed

 
josephine chen
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What class must an inner class extend ?
A. The top level class //it can extend any class
B. The Object class //yes
C. Any class or interface //yes
D. it must extend an interface //no
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If C were true, that would mean that an innner class MUST extend ANY class or interface. This statement makes no sense at all. It MAY extend any class or interface, yes, but you can't say that it MUST. Only B is true.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!