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 / kanu butani
There should be no confusion. Since both the interfaces are
been implemented and both have the same method, it will
work fine and will take any of the method.
Since there is no implementation in Interfaces it is
difficult to know which interface the method is read.
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
Can we define a package statement after the import statement in java?
Hi.... I applied for the post of scientific officer/Engineer-SB(Programmer).Please post the syllabus and sample papers.
How many types of literals are there in JAVA?
What is the use of static methods?
What is time complexity algorithm?
how would you implement a thread pool? : Java thread
What is lambda expression in java?
Is arraylist ordered in java?
Where are global variables stored?
how to deploy apache tomcat server to weblogic server in java
Can we start a thread twice in java?
What is return code?
What is hashing in java?
What does singleton class mean?
How large is a boolean?