When we need of abstract class and interface?could you please tell me the realtime example?

Showing Answers 1 - 1 of 1 Answers

Arundathi

  • Jul 1st, 2005
 

If there is a functionality (like employee) that is common across specific classes, then specific classes (Hourly Employee) can be inherited from the common class. What if there is no common functionality, but there is a common contract that classes have to follow.  
Interface is the java mechanism to define the contract that the classes should follow 
 
An abstract class can contain one or more abstract methods ? methods with no implementation

  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