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
Can we clone singleton class in java?
What is ternary operator in java?
What does function identity () do?
How to obtain a performance profile of java program
Can we create an object of private class?
Are constructors methods?
What is the difference between an array and an array list?
What is functional interface in javatpoint?
Why for each loop is used?
How to do encapsulation in java?
What is difference between iterator access and index access?
Why do we need hashmap in java?
Why java is used everywhere?
When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?
Is there any case when finally will not be executed?