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 is stringbuffer in java?
What is return null in java?
What does flagged out mean?
How to create a fecelet view?
How many types of parsers are there?
What are java methods?
What is return used for in java?
What are nested classes in java?
What do you understand by final value?
What is null statement?
Define locale.
Difference between overriding and overloading in java?
Java openings 3 - 5 years, Lnt Infotech. requirements - core java, J2ee, struts, hibernate Interview Date:- 19 March 2011 Time:- 9:00 AM to 12:00 Pm Interview Location - L & T Infotech, Manapakkam, Chennai Refererral PS NO:- 291649 (Please mention this when u fill the form only then u will be considered for interview) Documents Required:- Latest Resume, Photograph and last 3 payslips Mail me on vasan2211@gmail.com once u appear for interview
What are the different ways of implementing thread? Which one is more advantageous?
In Java list the methods that can be overridden?