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 / narayana
There should be no confusion. Since both the interfaces are
been implemented and both have the same method signature and
return type, 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 ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are recursive functions?
Is arraylist ordered in java?
Describe the Big-O Notation.
What are the advantages of exception handling in java?
How many static init can you have?
What is a variable analysis?
What does the “static” keyword mean? Can you override private or static method in java?
What is the default value of local and global variables?
Is string a datatype?
Explain the difference between call by refrence and call by value?
Why is java called the platform independent programming language?
What are parsers? Dom vs sax parser.
worst case complexities of Quick sort and Merge sort.
What is an empirical question?
Can we convert stringbuffer to string?