This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Abstract inner class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Abstract inner class" Watch "Abstract inner class" New topic
Author

Abstract inner class

Shiva Mohan
Ranch Hand

Joined: Jan 05, 2006
Posts: 477
Applying abstract modifier in member class is allowed.But how can I access mmm() method in the member class.Since this member class is abstract,it won�t allow me for instantiation like

Ppp.aaa myaaa=myppp.new aaa();

Is there any way to access the mmm() method.Please give a helping hand.

Divya Eknath
Greenhorn

Joined: Jul 27, 2006
Posts: 9
The abstract inner class's mmm() method cannot be called directly as abstract classes cannot be instantiated.You can extend the abstract inner class and call the method using the object reference of the subclass.
wise owen
Ranch Hand

Joined: Feb 02, 2006
Posts: 2023
Divya Eknath
Greenhorn

Joined: Jul 27, 2006
Posts: 9
ppp sup = new ppp();
ppp.aaa sub = sup.new aaa(){};

sub.mmm();
Shiva Mohan
Ranch Hand

Joined: Jan 05, 2006
Posts: 477
Thanks for the time and i got it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Abstract inner class
 
Similar Threads
how to access Inner class member
About static member of inner class
Inner Classes
Local class program error
Inner classes