1.

How Can We Define An Interface?

Answer»

In Java an interface just defines the methods and not implement them. Interface can include constants.

A CLASS that implements the interfaces is BOUND to implement all the methods defined in an interface.

Example of Interface :

public interface SAMPLE Interface 

{

public void function One();

public long CONSTANT_ONE = 1000;

}

In Java an interface just defines the methods and not implement them. Interface can include constants.

A class that implements the interfaces is bound to implement all the methods defined in an interface.

Example of Interface :

public interface sample Interface 

{

public void function One();

public long CONSTANT_ONE = 1000;

}



Discussion

No Comment Found