What is the use of Interface ?

What is the use of Interface ?

Java achieve inheritance using two notions : By extending the class and implementing the interface.

When you \"implement\" an interface, you are stipulating that your class adheres to the \"contract\" of the interface that you specified. Use interfaces to say \"What objects can do\" or \"What can be done to an object.

\"Interfaces are intended to define the what without defining the how. Interfaces provide a form of multiple inheritance. A class can extend only one other class. Interfaces are limited to public methods and constants with no implementation.


Interface


By:Jalees
Date:2014-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher