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

What is foreach loop in java?

1018


What does .equals do in java?

1098


How do you execute a thread in java?

954


What is the maximum size of arraylist in java?

1010


What does I ++ mean?

1065


What is an association?

987


What is Java Reflection API? Why it’s so important to have?

1165


What is polymorphism in java? What are the kinds of polymorphism?

1073


Can we override singleton class?

985


What is the difference between the direct buffer and non-direct buffer in java?

1032


How do you escape sequences in java?

1075


What is an infinite loop?

1255


What is lazy programming?

1041


What is flag in java?

992


What is passing by reference in java?

1023