Answers for "why we use interfaces in java"

8

interface in java

An interface is a special kind of class that cannot be instantiated.
 The main idea of an interface is declaring functionality. Interfaces help to 
 abstract from specific classes and emphasize the functionality. 
It makes software design more reusable and clean
Opposite to a class, an interface can extend several interfaces. 
A class can implement multiple interfaces.
Posted by: Guest on January-28-2022
1

interfaces are used as

It is used to achieve total abstraction.
 Since java does not support multiple inheritance in case of class, but by using interface it can achieve multiple inheritance .
 It is also used to achieve loose coupling.
Posted by: Guest on June-08-2021
0

interface in java

the main idea of an interface is declaring functionality.
Suppose you program a game that has several types of characters.
These characters are able to move within a map. That is represented by Movable
interface
Posted by: Guest on January-28-2022

Code answers related to "why we use interfaces in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language