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
Is Java a dying language?
What is the size of int in 64-bit jvm?
Why is stringbuffer faster than string?
What is the purpose of encapsulation?
What are the files generated after using IDL to java compiler?
Is special character in java?
What do you mean by order of precedence and associativity?
What is difference between checked and unchecked exception in java?
what is predefined function in java?
How do you convert an int to a double in java?
explain different ways of using thread? : Java thread
What does || || mean in math?
What is anagram number?
What is the instance of an object?
What kind of variables a class can consist of?