GeeCON Prague 2014*
The moose likes Book Reviews and the fly likes head first java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Books » Book Reviews
Reply locked New topic
Author

head first java

srikanth mycherla
Greenhorn

Joined: Oct 31, 2008
Posts: 26
In page 223 of head first java we have the concept of DEADLY DIAMOND OF DEATH .There we can see on class diagram where combodrive class inherits 2 base classes cdburner and dvdburner .

but in java there is no such issue like one derived class inherits two super classes !(multiple inheritance) we can't do it using classes
then how can one support the example of deadly diamond of death

there in pg 223 we can see on question which burn method runs when you call burn () on the combo drive? what does that mean ? when we cant make any combodrive class inherited from cdburner and dvdburner ?
why the question is framed like that when at all we cant inherit a derived class from 2 super classes

please correct me if iam wrong!
sanket karkare
Greenhorn

Joined: Jan 12, 2009
Posts: 10
srikanth mycherla wrote:In page 223 of head first java we have the concept of DEADLY DIAMOND OF DEATH .There we can see on class diagram where combodrive class inherits 2 base classes cdburner and dvdburner .

but in java there is no such issue like one derived class inherits two super classes !(multiple inheritance) we can't do it using classes
then how can one support the example of deadly diamond of death

there in pg 223 we can see on question which burn method runs when you call burn () on the combo drive? what does that mean ? when we cant make any combodrive class inherited from cdburner and dvdburner ?
why the question is framed like that when at all we cant inherit a derived class from 2 super classes

please correct me if iam wrong!


Above the figure, it is clearly mentioned that Multiple inheritance is a bad thing and is not possible in java.
Read the text above the class diagram again
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18874
    
  40


This forum is for book reviews !! In the future, please post topics in the correct forum.

Since this topic has been answered, I will just lock it, instead of moving it.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: head first java