Answers for "when to use an interface 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

java define interface

/* File name : Animal.java */
interface Animal {
   public void eat();
   public void travel();
}
Posted by: Guest on April-23-2020

Code answers related to "when to use an interface in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language