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 |
Why main method is called first in java?
What is the difference between a static and a non-static inner class in java programming?
Can java program run without jre?
What is a dynamic array java?
Tell me the Importent classes in net package?
What is the purpose of object oriented programming?
Explain notifyall() method of object class ?
Explain different types of thread priorities ?
What are the differences between include directive and include action?
What do you mean by buffering?
What’s the difference between the methods sleep() and wait()?
How do you convert an int to a double in java?