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 is difference between path and classpath variables?
Explain where variables are created in memory?
Is array synchronized in java?
What is jee6?
What is a lambda expression ? What's its use ?
What is meant by binding in rmi?
What are the five major types of reference sources?
What is the final method?
How will you invoke any external process in java?
Is void a wrapper class?
When we should use serialization?
Explain public static void main(string args[]).
Are arrays classes in java?
What is type parameter in java?
Difference between static and dynamic class loading.