Geeks Talk

Prepare for your Next Interview




Java

This is a discussion on Java within the OOPS forums, part of the Software Development category; Why Multiple Inheritance is not supported by java?...

  #1 (permalink)  
Old 02-25-2008
Junior Member
 
Join Date: Feb 2008
Posts: 3
Thanks: 0
Thanked 3 Times in 2 Posts
varanasisaikarthik is on a distinguished road
Post Java

Why Multiple Inheritance is not supported by java?
Reply With Quote
The Following User Says Thank You to varanasisaikarthik For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 05-03-2008
Junior Member
 
Join Date: Sep 2007
Location: New Delhi,NCR (India)
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
SoftDev is on a distinguished road
Re: Java

Hi!

Because, there are a lots of minutes issues if we use class-based multiple inheritance.
Although Java support interface-based multiple inheritance...

Enjoy Development
Reply With Quote
  #3 (permalink)  
Old 09-07-2008
Junior Member
 
Join Date: Sep 2008
Location: india
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
mkranthikumar.mca is on a distinguished road
Re: Java

The main objective of OOP is to provide security. But through the multiple inheritance one class data will be available to the other classes that means we r not providing security for the classes.
Thats why multiple inheritance was not supported by Java. But it indirectly supports through the interfaces. In interfaces we can inherit more than one interfaces.
Reply With Quote
  #4 (permalink)  
Old 09-08-2008
Expert Member
 
Join Date: Jun 2007
Location: Australia
Posts: 242
Thanks: 6
Thanked 8 Times in 8 Posts
Sushma Mosali is on a distinguished road
Re: Java

hi,

this is discussed in the forum, please refer to this link also, hope it will be helpful to you OOPS - why is multiple inheritance not allowed in java?

Thanks
Sushma
Reply With Quote
  #5 (permalink)  
Old 09-08-2008
Junior Member
 
Join Date: Sep 2008
Location: pune
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
amoljore is on a distinguished road
Re: Java

to avoid ambiguity
Reply With Quote
  #6 (permalink)  
Old 10-06-2008
Junior Member
 
Join Date: Oct 2008
Location: bangalore
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
varunkumar28 is on a distinguished road
Re: Java

In C++ there was concept of multiple inheritance,but threre was some ambiguity in the method names,if two classes have same method name then it was difficult to know which method is being called ,if class inherriting both of those classes.
So to reduce compexity and ambiguity java supports only single inheritence,however it can inherit multiple interfaces.
Reply With Quote
  #7 (permalink)  
Old 10-16-2008
Contributing Member
 
Join Date: Oct 2008
Location: tamilnadu,india
Posts: 74
Thanks: 2
Thanked 5 Times in 5 Posts
rakesh trichy is on a distinguished road
Re: Java

Whenever you find yourself asking why Java has or does not have some feature, consider the design goals behind the Java language. With that in mind, I started my search by skimming through "The Java Language Environment" by James Gosling and Henry McGilton (Sun Microsystems), a white paper published in May 1996 that explains some of the reasoning behind Java's design.

As the white paper states, the Java design team strove to make Java:

* Simple, object oriented, and familiar
* Robust and secure
* Architecture neutral and portable
* High performance
* Interpreted, threaded, and dynamic



The reasons for omitting multiple inheritance from the Java language mostly stem from the "simple, object oriented, and familiar" goal. As a simple language, Java's creators wanted a language that most developers could grasp without extensive training. To that end, they worked to make the language as similar to C++ as possible (familiar) without carrying over C++'s unnecessary complexity (simple).

In the designers' opinion, multiple inheritance causes more problems and confusion than it solves. So they cut multiple inheritance from the language (just as they cut operator overloading). The designers' extensive C++ experience taught them that multiple inheritance just wasn't worth the headache.
Reply With Quote
Reply

  Geeks Talk > Software Development > OOPS


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
From Java to .NET viswanath Career Advice 2 05-03-2008 08:20 AM
How to set path for java in Linux for java programs jitudash Java 2 04-24-2008 07:15 AM
How to test java project in QTP without java addin Geek_Guest QTP 7 09-18-2007 07:53 AM
is java is a.. samineni6 Java 5 06-07-2007 02:45 AM
Java rajesh.tripathi Java 2 04-26-2007 07:35 AM


All times are GMT -4. The time now is 05:48 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved