When to use Interface over abstract class?

Showing Answers 1 - 2 of 2 Answers

Kiran

  • Jun 24th, 2005
 

I want to know when to use interface over abstract class. One reason could be because you are extending another class. But it wont be known until some one implements the interface. So I want to know in Java API how came up with decisions that some thing should be interface/ abstract class. I am able to find the difference between interface and abstract class, but not when it should be used.

  Was this answer useful?  Yes

John

  • Jun 24th, 2005
 

This is what I feel about Interface, Actually Interface is very good in Designing the Class Structure. Whenever user want to use or implement a class and u want it to be implemented in a manner, or the class should have at least these methods U can specify the Interface. For example If u go through the JTA APIs these APIs are not implemented by Sun, Sun gives Third party vendors to create methods by implementing these interfaces.

  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