Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Is upper case in java?

947


What is __ init __ functions?

1094


What is the multi-catch block in java?

1018


Is singleton a bad practice?

1020


How do you define a singleton class?

1058


Can we have two methods in a class with the same name?

1045


how to open and edit XML file in Weblogic???

1959


How many types of methods are there in java?

990


What is the main use of generics in java?

971


What is the char data type?

983


How do you compare two objects?

917


Can I import same package/class twice?

939


What is the use of default method in interface in java? Explain

982


write a program that list all permutations of ABCDEF in which A appears before B?

2466


explain what is transient variable in java?

1104