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 exactly is java?
What invokes a thread's run() method in java programming?
How does compareto work in java?
In java how do we copy objects?
Is stringwriter thread safe?
Why is stringbuffer thread safe?
What is pangram in java?
How many bits is a char?
Can we override private method?
What are different ways of object creation in java ?
What are the string methods in java?
Explain working of call by reference function invoking.
What is difference between protected and private?
Why does java have different data types for integers and floating-point values?
What is t in generics in java?