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

What do you mean by boolean?

1024


What does a boolean method return?

1160


How to implement an arraylist in java?

1059


What is the transient keyword?

2041


How to display names of all components in a Container?

2892


What does microservices mean?

905


What are the differences between forwarding () method and sendredirect() methods?

1067


What is exception in java?

1027


Explain about sets?

955


String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?

927


Can we serialize singleton class?

982


What is an abstract method in java programming?

984


What are the features of java?

1014


What is a package in java? List down various advantages of packages.

1207


What about features of local inner class?

1015