+ 1
what are interfaces in java
n new to java and want to learn it sincerely :)
9 Réponses
+ 3
It is used to achieve fully abstraction.
By interface, we can support the functionality of multiple inheritance.
It can be used to achieve loose coupling.
interface shivanidalmia{
void print();
}
class A implements shivanidalmia {
public void print(){System.out.println("Hello");}
public static void mai n(String args[]){
A obj = new A();
obj.print();
}
}
+ 2
An interface is a reference type in Java, it is similar to class, it is a collection of abstract methods.
+ 2
think of an interface as a contract. For instance List interface is a contract and any class that implements the interface such as ArrayList will implement the iList interface methods.
Ex:
public interface List {}
+ 1
can u explain this with any simple example
+ 1
oh okie..so y we use interfaces and how
syntax?
0
For example, The buttons on the front of your television set, are the interface between you and the electrical wiring on the other side of its plastic casing. You press the "power" button to turn the television on and off.
In its most common form, an interface is a group of related methods with empty bodies.
0
thank u to both of u :)
nw a lil clear bout the topic
just asking - which print method will b calld n y
0
ChOOSe863usernarjampartick
Guid
Easdrfgim
RWDWEGGFNK 😷🙂 the same thing as the name of your
0
hi