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
What is foreach loop in java?
What is the size of arraylist in java?
What are the different tags provided in jstl?
What are instance variables?
What is the significance of listiterator?
What is an 8 bit word?
What is advantage of java?
What is passing by reference in java?
How does system arraycopy work in java?
Give me an example of array and linked list? Where they can be used?
What is a condition in java?
Name container classes in java programming?
Explain covariant method overriding in java.
Define jit compiler?
What is difference between java and java ee?