Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there a purpose to this?

 
chafule razgul
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the purpose of being able to create a abstract inner class/interface within a final class?
is it solely for other solid inner classes within the final class to implement it?
TIA!
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No you can subclass it in some other class too (provided B is static of course).
Here is an example of how you could use it:

I wouldn't do that too much, though. Inner classes kinda clutter the code in my opinion. I rarely use them, but it's a matter of taste I guess...
[ February 21, 2002: Message edited by: Valentin Crettaz ]
 
chafule razgul
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Valentin.. i didn't know you can have abstract static inner classes.. Does what you stated also apply to non-static inner classes in a final enclosing class?
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only if C is in the same final class than B, that is:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic