Any one can explain how the inerface uses in java. give with
example.
Answer / yogesh sanas
Interface is a contract between class and interface. Interface has some public abstract methods which class needs to be implement.
We can achieve polymorphism using Interface.
e.g.
Interface Interface_Name(){
int add(int x, int y);
}
Class MyClass implements Interface_Name{
public int add(int x, int y){
return x+y;
}
}
| Is This Answer Correct ? | 0 Yes | 1 No |
What is append function?
What is a hashmap used for?
What is the effect of keeping a constructor private?
What does a za z0 9 mean?
How do you make an arraylist empty in java?
What are the different conditional statements?
How many bits is a string?
What is stringwriter?
A abstract class extending an abstract class.Super class has both abstract and non-abstract methods.How can we implement abstract and non-abstract mehtods? Explain with snippet
Is hashset sorted in java?
What is java util?
How does arraylist work in java?