Abstract class is a partially implemented class so, How can we call an abstract method without creating a subclass.

Showing Answers 1 - 15 of 15 Answers

Ravi

  • Dec 11th, 2006
 

We can not instalize abstract or interface without subclassing it.

  Was this answer useful?  Yes

Having some1 else be implmnting da abstrct clazz. This may seem like silly idea, but not! used all time. taking ActionListeners for example (I iz knowign that they are being interfaces, but matters not). Deep in the bowes of teh Jav are the codings for da buttons, it looking like:[codings]onButtonPressed() { for each ActionListener actionListener.actionaficated();}[/codings]but at this point, not action listeners are coded. So how is it workings?! U r codings the Action Listener, rather than teh Jav.

  Was this answer useful?  Yes

sayoke

  • Dec 12th, 2006
 

The only option I see is, if the method is static then calling it as .else the other option is making subclass.

  Was this answer useful?  Yes

sayoke

  • Dec 12th, 2006
 

another useful method is to use reflextion api. But this is not recommended. It will also ask users knoledge to a very lower level.

  Was this answer useful?  Yes

I am not sure, but if ABS class can have a static member function (I am not sure either about if ABS class can have static member function), then without instantiating an OBJ of ABS class, the class function can be invoked.


Guys, please check it, and update here...
It will be helpful for others too.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions