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

What is the reason that multiple inheritance is not possible
in java??

Answer Posted / gayathri

This is to avoid "Diamond problem"....Lets say there are 4 classes A,B,C,D..A is a superclass...The two classes B and C inherit from A, and class D inherits from both B and C. If a method in D calls a method defined in A (and does not override the method), and B and C have overridden that method differently, then from which class does it inherit: B, or C? ...To avoid this issue, Java dint allow multiple inheritance..
Having said that, also note that Java allows multiple inheritance through multiple interface implementation

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi friends am new to java. I read jar file means collection of java files. For executing struts application what are the necessary jar files. " struts.jar " file contains what. can u explain

1973


Is stringwriter thread safe?

1051


What is the use of coding?

1013


Where are the local variables stored?

1123


What are multiple inheritances?

1151


What do you mean by synchronized non access modifier?

1047


How are the elements of a gridbaglayout organized in java programming?

1027


Can we store variables in local blocks?

1408


How is garbage collection controlled?

1226


How many types of parsers are there?

1065


Why are getters and setters used?

1105


I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?

1068


Which is bigger float or double java?

1026


Can bool be null?

1033


How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?

1012