This is my code i have a doubt
class ab implements a,b
{
public void add()
{
System.out.println("Hi")
}
}
interface a
{
public void add();
}
interface b
{
public void add();
}
in this code i have two interface implemented in the class
has same method.just i want to know which method of
interface implemented in the class. interface a or interface
b? confused me .
Answer Posted / kanu butani
There should be no confusion. Since both the interfaces are
been implemented and both have the same method, it will
work fine and will take any of the method.
Since there is no implementation in Interfaces it is
difficult to know which interface the method is read.
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
Explain the importance of thread scheduler in java?
What is string substring?
What are the benefits of operations in java?
What is java util list?
What is void keyword?
State the significance of public, private, protected class?
Is a case study a method or methodology?
What does compareto () do in java?
What is a string what operation can be performed out with the help of a string?
Can we modify the throws clause of the superclass method while overriding it in the subclass?
What is meant by JVM? Is JVM platform independent or not?
Give any two differences between C++ and java.
How is Object Oriented Programming different from Procedure Oriented Programming?
What is t in generics in java?
What is string intern in java?