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

why java not supproting multiple inheritance?

Answer Posted / aman kr. aggarwal

well as in c++ we have multiple inheritance, but not in java

becz if it is their then having method of same signature
(means same return type, list of paraments, access
specifiers) in 2 different classes and both r extended by
some class AA then while calling method in base class, it
would break down the jvm that to which classes method to be
called.
EX:-
class BB
{
public void a(int x)
{
System.out.println("call from BB");
}
}
class CC
{
public void a(int x)
{
System.out.println("call fro CC");
}
}
class AA extends BB,CC
{
a(5);
}

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I want to print “hello” even before main is executed. How will you acheive that?

1047


What is a method signature java?

989


Explain what access modifiers can be used for methods?

1030


How do you start a thread?

978


Define how does a try statement determine which catch clause should be used to handle an exception?

1066


What is meant by method overriding?

1034


How to retrieve data from database in java using arraylist?

992


What is sortedmap in java?

976


Which class is the superclass for every class in java programming?

938


Can we assign null to double in java?

961


How do you write a scanner class in java?

953


Can the garbage collection be forced by any means?

932


What is scope of a variable?

1037


What is complexity in java?

963


Why strings in java are called as immutable?

946