File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Is there a purpose to this? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Is there a purpose to this?" Watch "Is there a purpose to this?" New topic
Author

Is there a purpose to this?

chafule razgul
Ranch Hand

Joined: Feb 09, 2002
Posts: 63
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

Joined: Aug 26, 2001
Posts: 7610
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 ]

SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
chafule razgul
Ranch Hand

Joined: Feb 09, 2002
Posts: 63
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

Joined: Aug 26, 2001
Posts: 7610
Only if C is in the same final class than B, that is:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is there a purpose to this?