File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Inner class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Inner class" Watch "Inner class" New topic

Inner class

meena latha
Ranch Hand

Joined: Jan 24, 2005
Posts: 219
This program gives compile error stating "enclosing instance that contains Outer.Inner is required.

Can anybody explain what that error means.
Thanks in advance
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
You have to call the superclass constructor on an instance of the enclosing class. I would have thought would do it, but this version compiles:

Somehow, I doubt that Kathy would put this one on the SCJP exam.
[ February 28, 2005: Message edited by: Mike Gershman ]

Mike Gershman
SCJP 1.4, SCWCD in process
I agree. Here's the link:
subject: Inner class
jQuery in Action, 3rd edition