my dog learned polymorphism
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
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
It's not a secret anymore!