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 / 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


Please Help Members By Posting Answers For Below Questions

What do you mean by data type?

1063


What are the different ways of creating thread?

1059


What is difference between synchronize and concurrent collection in java?

1122


What is a generic type?

1055


What is the use of StringTokenizer class?

1111


what is the purpose of the wait(), notify(), and notifyall() methods? : Java thread

1044


What is strings in java?

1089


What is an example of character?

1203


What is finally in Java?

1132


What are different type of exceptions in java?

1016


Why are the methods of the math class static?

1124


What is byte code and why is it important to java’s use for internet programming?

1197


What is executor memory?

1001


What comes to mind when someone mentions a shallow copy in java?

1164


Tell me the Importent classes in net package?

2039