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 / gohil
You can dynamically implement any of the interface
Ex
a intAImpObj= new ab();
b intBImpObj= new ab();
In above case intAImpObj is the implementation of a
interface and intBImpObj is the implementation of b interface
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain java code for recursive solution's base case?
What is treemap in java?
What is tostring () method?
What is fail first in java?
What is parse method?
How does linkedhashmap work in java?
What is array length in java?
why not override thread to make a runnable? : Java thread
What is use of static method?
whatis Home interface and Remoteinterface? with example?
What are use cases?
What is fail fast in java?
What is an immutable object? How do you create one in java?
What is the main difference between java platform and other platforms?
What does s mean in regex?