Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What class must an inner class extend ?

 
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 ---- does it mean static inner class ??
B. The Object class //yes
C. Any class or interface //yes
D. it must extend an interface //no
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Must"? and, "Directly"? or indirectly?



It must extend Object or any other class. If it implements an interface only (like in an anonymous class), then it implicitly extends the class Object.
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shan
Welcome to the Java Ranch, we hope you’ll enjoy visiting as a regular however,
your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy.
Thanks again and we hope to see you around the ranch!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic