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 do we declare a class static?
How do you use substring in java?
Can list be null in java?
What are the three types of design patterns?
What is unicode with example?
What is the right data type to represent a price in java?
Which software is used for java programming?
How to perform linear search in java?
What do you mean by collectors in java 8?
What are the differences between heap and stack memory?
What is the significance of continue jump statement? Explain with an example.
what is the use of clone() in real time scenario?