jQuery in Action, 2nd edition*
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Extending inner class problem." Watch "Extending inner class problem." New topic
Author

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
so(){
System.out.println("so");
}
class s{ // inner class
s(){
System.out.println("s");
}
}
}

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

c(){
System.out.println("c");
}
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: http://aspose.com/file-tools
 
subject: Extending inner class problem.