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
Why is string class considered immutable?
Why do we use bufferedreader?
What is the main function in java?
Which types of exceptions are caught at compile time?
What is difference between null and void?
What are the drawbacks of singleton class?
What is public static?
EDS (Electronic Data Systems India Pvt Ltd) at Chennai on 16-12-2006.
how its run?
What is the difference between final, finally and finalize() in java?
What is the difference between ArrayList and Vector? which one is better in Java
How does multithreading take place on a computer with a single cpu?
What is string and its types?
Can list be null in java?
What is methods in java?