GIDForums  

Go Back   GIDForums > Computer Programming Forums > Java Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 30-Nov-2008, 07:26
khushal_kkk's Avatar
khushal_kkk khushal_kkk is offline
Awaiting Email Confirmation
 
Join Date: Mar 2008
Posts: 50
khushal_kkk is an unknown quantity at this point

Multiple Inheritence In Java ... ?


Need Some Knolwedge About Java as I am New To Java And Reading Books But Need Its Explaination In Clear Words Not Technichal WOrds.

Q :: Why Multiple Inheritence Is not possible in Java . Give a Brief explanantion please as Soon as Possible.

REGARDS
  #2  
Old 05-Feb-2009, 14:36
blakekl's Avatar
blakekl blakekl is offline
Junior Member
 
Join Date: Nov 2007
Posts: 35
blakekl will become famous soon enough

Re: Multiple Inheritence In Java ... ?


Because with multiple inheritance, there is a problem that arises called the diamond of death. This occurs if a class inherits from multiple classes. All the methods of that class are copied into the class that inherits them. If both superclasses had methods with the same name and parameters, which one would be used? multiple inheritance often produces ambiguous, unclear results. Because of this, java does not allow multiple inheritance.
  #3  
Old 15-Feb-2009, 22:05
mamz mamz is offline
New Member
 
Join Date: Jan 2008
Posts: 19
mamz is on a distinguished road

Re: Multiple Inheritence In Java ... ?


but you can implement multiple interfaces in java. Here since the methods are all abstract and thus has no method body, you are free to add your own method body.thus 'diamond of death' will never occur.
  #4  
Old 21-Apr-2009, 19:20
S8G Legend SG S8G Legend SG is offline
New Member
 
Join Date: Feb 2009
Posts: 4
S8G Legend SG is on a distinguished road

Re: Multiple Inheritence In Java ... ?


and you can also chain objects together with inheritance.

example: i am making a tower defense game for a class at the moment.

any basic object of a game is an Entity, my tower, creep, and bullet base classes extend Entity, the different styles of towers creeps and bullets extend their respective base classes.

so a basicTower is a Tower which is an Entity.

so basicTower has all of the functionality of an Entity
 
 

Recent GIDBlogProblems with the Navy (Enlisted) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error C2374 lolp1 C++ Forum 3 25-May-2008 16:40
To post messages / click Buttons of a Java Jar App using code Jun0 C Programming Language 1 06-Jan-2007 14:44
To post messages / click Buttons of a Java Jar App using code Jun0 Java Forum 0 06-Jan-2007 11:14
Scalability in Java and C++ agx Miscellaneous Programming Forum 7 04-Feb-2006 15:35
Linker errors with multiple file progam nkhambal C Programming Language 2 24-Apr-2005 02:37

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 09:37.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.