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 |
How many objects are created when we create String class object using new operator?
If we don’t want some of the fields not to serialize how to do that?
What is a ternary operator in java? What is an interface?
Can we override constructor in java?
What is collection sort in java?
How do you sort a string in java?
what is request processor?
How do you check if a string is lexicographically in java?
Can a class have a static inner class?
What is class and object in java?
What is the difference between ArrayList and Vector? which one is better in Java
0 Answers SkillGun Technologies,
What things should be kept in mind while creating your own exceptions in java?