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 use of super keyword in java?
What do you mean by an interface in java?
What are the advantages of inner classes?
Write a program to print fibonacci series up to count 10.
What is the formula to calculate percentage?
Is 9 a prime number?
What is the difference between jfc & wfc?
extending thread class or implementing runnable interface. Which is better? : Java thread
What is mnemonic code?
What is java full form?
What is the symbol for average?
Name container classes in java programming?
What is the destroy method?
What is the symbol for line break?
How does linkedlist work in java?