This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Extending inner class problem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Extending inner class problem." Watch "Extending inner class problem." New topic

Extending inner class problem.

ramya ray
Ranch Hand

Joined: Aug 11, 2006
Posts: 101
Hi ,

Kindly describe whats wrong with the below code is it correct way t extend an inner class as in below code:

class so{ //outer class
class s{ // inner class

class c extends so.s{ //extending inner class
int i =10;

public static void main(String args[]){
c c1 = new c();

while compiling it is giving error: an enclosing instance that contains so.s is required c(){
Please explain whats wrong in it

Thanks for all your support
wise owen
Ranch Hand

Joined: Feb 02, 2006
Posts: 2023
How to inherit from an inner class?
I agree. Here's the link:
subject: Extending inner class problem.
It's not a secret anymore!