interface in java

An interface in java is a blueprint of a class. It has 
-static constants and
- abstract methods.

The interface in java is a mechanism to achieve abstraction. There can be only abstract methods in the java interface not method body. It is used to achieve abstraction and multiple inheritance in Java.

In other words, you can say that interfaces can have methods and variables but the methods declared in interface contain only method signature, not body.

Java Interface also represents IS-A relationship.
It cannot be instantiated just like abstract class.



Comments

Popular posts from this blog

Lab Network 2024

Step to publish your static html web page to GitHub

Tutorial OOP(reversion java)