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 support multiple inheritance

Answer Posted / mahesh patil

Suppose consider a method aaa() which is in class Z.

Suppose a programmer ABC inherited the class Z to class X
and overrided the aaa().So this class will have the new
implementation of aaa().
Suppose a programmer DEF inherited the class Z to class Y
and overrided the aaa().So this class will have the new
implementation of aaa().

If Multiple Inheritance is permitted in java, then if the
new programmer inherited both the classes and he didn't done
any overriding of method aaa() then if he calls the aaa()
,the JVM will not know which method to call i.e., either the
method in class X or method in class Y.

Because of this inconsistencies,Multiple inheritance is not
permitted in java.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can arraylist hold different types java?

1038


What is instance synchronization?

1104


Why are pointers not secure?

1074


What’s a deadlock?

1146


Why we override equals() method?

1082


Explain the difference between treeset and treemap in java?

1047


What is a string token?

1123


What is thread life cycle in java?

1136


If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?

1090


Can private class be extended java?

1089


How do you calculate square roots?

1216


How to convert string to char and vice versa?

1049


How many types of classes are there in java?

1115


Why do we use predicate in java?

1093


Can a singleton class be inherited?

1012