• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Abstract inner class

 
Shiva Mohan
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Divya Eknath
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ppp sup = new ppp();
ppp.aaa sub = sup.new aaa(){};

sub.mmm();
 
Shiva Mohan
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the time and i got it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic