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 does not supports multiple inheritance?

Answer Posted / shree

Multiple inheritance eliminated from java because it leads to confusion in many of cases & causes ambiguity.
So to avoid that complexity java does not support multiple inheritance.

/Multiple inheritance program
Class A
{
public void show(){.....}
}

Class B extends A
{
public void show(){.....}
}

Class C extends A{
public void show(){......}
}
Class D extends B,C{ // not supported by java leads to syntax error.
}


Here class D will get confuse which show() method to execute as there are 2 show() methods are available inherited from class B & C.


but to provide functionality of inheritance java provides new concept called 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 are java annotations?

1083


Does substring start with 0?

941


Can we have try without catch block?

1036


What is a method in coding?

998


What is difference between final and finally in java?

1038


What is a java predicate?

922


If system.exit (0); is written at the end of the try block, will the finally block still execute?

1045


What is the replace tool?

1080


What is better - 'bit-shift a value' or 'multiply by 2'?

1125


Can we overload destructor in java?

936


What is the use of put method?

902


Write a factorial program using recursion in java?

958


What are the advantages and disadvantages of reference counting in garbage collection?

978


Is treeset sorted in java?

936


Can arraylist hold different types java?

931