Answer to Question #90790 in Java | JSP | JSF for sravanthi

Question #90790
what is the use of interfaces in java
1
Expert's answer
2019-06-13T07:01:27-0400

Answer:

Interfaces allow you to specify exactly what classes should do, without specifying exactly how they should do it.

The interface in Java is not a class. It is a series of requirements for a class that must meet the interface.

The interface cannot have instance fields or static methods, it can declare constants and describe methods.

Java does not support multiple inheritance. But each class can implement any number of interfaces.

A class implementing an interface must implement all its methods

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Assignment Expert
13.06.19, 16:11

Dear Paul, the inheritance of classes is often understand by the multiple inheritance, while implementation of interface is implementation of interface, not pure inheritance.

Paul Anthony
13.06.19, 12:34

Java uses Interface to implement multiple inheritance. A Java class can implement multiple Java Interfaces

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS