aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes [to - Eric]..inner class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "[to - Eric]..inner class" Watch "[to - Eric]..inner class" New topic

[to - Eric]..inner class

chao-long liao
Ranch Hand

Joined: Jul 29, 2001
Posts: 78
Inner classes are real classes, and can be manipulated the same as "top-level" classes,an inner class can implement an interface or extend a class.
//try this code
interface S{}
class Base {}
public class A{
public static void main(String argv[]){}
private class inner extends Base implements S{}
Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

Nice liao! The code shows that inner classes can also extend
interfaces like package-level classes...


Ashik Uzzaman
Senior Member of Technical Staff,, San Francisco, CA, USA.
Eric Pramono
Ranch Hand

Joined: Jul 09, 2001
Posts: 74
Thanks Liao..
Really appreciate it..
Regarding my other thread...
I think that anonymous class is the one that cannot extends an explicit class and implements an interface at the same time..
am I right?
- eric
Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

U should be right eric!
I agree. Here's the link:
subject: [to - Eric]..inner class