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



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

Answer / 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

More Core Java Interview Questions

When should a function throw an exception?

0 Answers   Thomson Reuters, Virtusa,


can we write a program with out a class in core java?

11 Answers   Wipro,


What is enhanced loop in java?

0 Answers  


When will you define a method as static in Java?

0 Answers   SwanSoft Technologies,


What is logical variable?

0 Answers  


What is map and hashmap? also tell the difference.

1 Answers  


What is parsing in grammar?

0 Answers  


What do you understand by classes in java?

0 Answers  


how to handle exceptions in core applications?

2 Answers   CSS,


What are parsers? Dom vs sax parser.

0 Answers  


What data type is string java?

0 Answers  


What is the access scope of a protected method?

0 Answers  


Categories