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


Please Help Members By Posting Answers For Below Questions

What is difference between path and classpath variables?

840


Explain where variables are created in memory?

797


Is array synchronized in java?

841


What is jee6?

777


What is a lambda expression ? What's its use ?

842


What is meant by binding in rmi?

810


What are the five major types of reference sources?

773


What is the final method?

862


How will you invoke any external process in java?

878


Is void a wrapper class?

751


When we should use serialization?

816


Explain public static void main(string args[]).

884


Are arrays classes in java?

758


What is type parameter in java?

734


Difference between static and dynamic class loading.

840