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 static and final keyword in java?
What is a pointer and does java support pointers?
What is final class?
How many bits is a string in java?
How can a gui component handle its own events?
What is a nested structure?
Why can't we make jsp as a controller and action servlet in struts?
Explain about complier design(phases)
0 Answers Aditi Placement Service,
While opening the file, what type of exceptions can be caught?
what is multitherading
Is array a class in java?
Is array passed by reference in java?