View Nirupama  Pathak 's Profile
How to define an Interface in Java ?
In Java Interface defines the methods but does not implement them. Interface can include constants. A class that implements the interfaces is bound to implement all the methods defined in Interface.
Emaple of Interface:

public interface sampleInterface {
public void functionOne();

public long CONSTANT_ONE = 1000;
}
Asked by Nirupama Pathak | Dec 6 2018 | Report this Report abuse
Replies (11)
View Roshan  shah 's Profile
Is Iterator a Class or Interface? What is its use?
Dec 14 2018 | Report this Report abuse
View Shivendu  Chatterjee 's Profile
Like a class, an interface can have strategies and factors, yet the techniques proclaimed in interface are as a matter of course conceptual (just strategy signature, no body).

Interfaces indicate what a class must do and not how. It is the plan of the class.

An Interface is about abilities like a Player might be an interface and any class actualizing Player must have the capacity to (or must execute) move(). So it indicates a lot of strategies that the class needs to execute.

On the off chance that a class actualizes an interface and does not give technique bodies to all capacities determined in the interface, at that point class must be announced theoretical.

A Java library model is, Comparator Interface. In the event that a class actualizes this interface, it tends to be utilized to sort an accumulation.
Dec 14 2018 | Report this Report abuse
View Diksha  Basu 's Profile
Like a class, an interface can have strategies and factors, yet the techniques proclaimed in interface are as a matter of course conceptual (just strategy signature, no body).

Interfaces indicate what a class must do and not how. It is the plan of the class.

An Interface is about abilities like a Player might be an interface and any class actualizing Player must have the capacity to (or must execute) move(). So it indicates a lot of strategies that the class needs to execute.

On the off chance that a class actualizes an interface and does not give technique bodies to all capacities determined in the interface, at that point class must be announced theoretical.

A Java library model is, Comparator Interface. In the event that a class actualizes this interface, it tends to be utilized to sort an accumulation.
Dec 14 2018 | Report this Report abuse
View Khushi   Kumari 's Profile
As mentioned above they are used for abstraction. Since methods in interfaces do not have body, they have to be implemented by the class before you can access them. The class that implements interface must implement all the methods of that interface. Also, java programming language does not support multiple inheritance, using interfaces we can achieve this as a class can implement more than one interfaces, however it cannot extend more than one classes.

To Know More Visit the :-http://www.cetpainfotech.com/technology/java-training
Dec 13 2018 | Report this Report abuse
View Shivendu  Chatterjee 's Profile
As mentioned above they are used for abstraction. Since methods in interfaces do not have body, they have to be implemented by the class before you can access them. The class that implements interface must implement all the methods of that interface. Also, java programming language does not support multiple inheritance, using interfaces we can achieve this as a class can implement more than one interfaces, however it cannot extend more than one classes.

To Know More Visit the :-http://www.cetpainfotech.com/technology/java-training
Dec 13 2018 | Report this Report abuse
View Shivendu  Chatterjee 's Profile
For such type of query and certification you can check the link below

http://www.vskills.in/certification/Certified-Core-Java-Developer
Dec 13 2018 | Report this Report abuse
View Khushi   Kumari 's Profile
For such type of query and certification you can check the link below

http://www.vskills.in/certification/Certified-Core-Java-Developer
Dec 13 2018 | Report this Report abuse
View Chinmay  Hegde 's Profile
Unless the class that executes the interface is conceptual, every one of the techniques for the interface should be characterized in the class. An interface can contain any number of strategies. An interface is composed in a record with a .java expansion, with the name of the interface coordinating the name of the document.
Dec 13 2018 | Report this Report abuse
View Tanya  Sharma 's Profile
Unless the class that executes the interface is conceptual, every one of the techniques for the interface should be characterized in the class. An interface can contain any number of strategies. An interface is composed in a record with a .java expansion, with the name of the interface coordinating the name of the document.
Dec 12 2018 | Report this Report abuse
View Shivendu  Chatterjee 's Profile
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. It cannot be instantiated just like abstract class.
http://www.cetpainfotech.com/technology/java-training
Dec 12 2018 | Report this Report abuse
View Shatish  Rao 's Profile
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. It cannot be instantiated just like abstract class.
http://www.cetpainfotech.com/technology/java-training
Dec 12 2018 | Report this Report abuse