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
What do you mean by data type?
What are the different ways of creating thread?
What is difference between synchronize and concurrent collection in java?
What is a generic type?
What is the use of StringTokenizer class?
what is the purpose of the wait(), notify(), and notifyall() methods? : Java thread
What is strings in java?
What is an example of character?
What is finally in Java?
What are different type of exceptions in java?
Why are the methods of the math class static?
What is byte code and why is it important to java’s use for internet programming?
What is executor memory?
What comes to mind when someone mentions a shallow copy in java?
Tell me the Importent classes in net package?