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 java abstraction with example?

1041


What is the public field modifier?

1007


What are the different types of java?

1040


What is the difference between compile-time polymorphism and runtime polymorphism?

979


Write a program to print all permutations of string?

1096


How can a gui component handle its own events in java programming?

1026


Why do we need wrapper classes?

1049


how many types of Inheritance?

1149


What is hash code collision?

1036


When do we use synchronized methods in java?

1032


What is the difference between conversation & casting?

1029


Why main method is static in java?

1154


What are the advantages of user defined functions?

977


Why are constructors used?

1011


Explain Basics of OOP Language in java

1036