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 | Feb 14 2019 | Report this Report abuse
Replies (11)
View Shivendu  Chatterjee 's Profile
Java uses Interface to implement multiple inheritances. A Java class can implement multiple Java Interfaces. All methods in an interface are implicitly public and abstract. To use an interface in your class, append the keyword "implements" after your class name followed by the interface name.
Feb 18 2019 | Report this Report abuse
View Diksha  Basu 's Profile
Java uses Interface to implement multiple inheritances. A Java class can implement multiple Java Interfaces. All methods in an interface are implicitly public and abstract. To use an interface in your class, append the keyword "implements" after your class name followed by the interface name.
Feb 18 2019 | 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
Feb 18 2019 | 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
Feb 18 2019 | Report this Report abuse
View Khushi   Kumari '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.
Feb 18 2019 | Report this Report abuse
View Khushi   Kumari '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.
Feb 18 2019 | Report this Report abuse
View Shatish  Rao '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.
Feb 18 2019 | Report this Report abuse
View Roshan  shah '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.
Feb 17 2019 | Report this Report abuse
View Chinmay  Hegde 's Profile
For such type of query and certification you can check the link below

http://www.vskills.in/certification/Certified-Core-Java-Developer
Feb 17 2019 | 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
Feb 16 2019 | Report this Report abuse
View Tanya  Sharma 's Profile
Iterator is an interface which is used to step through the elements of a Collection.
Feb 16 2019 | Report this Report abuse