Comments on: Multiple Inheritance in Java http://www.terminally-incoherent.com/blog/2006/09/14/multiple-inheritance-in-java/ I will not fix your computer. Tue, 04 Aug 2020 22:34:33 +0000 hourly 1 https://wordpress.org/?v=4.7.26 By: Luke http://www.terminally-incoherent.com/blog/2006/09/14/multiple-inheritance-in-java/#comment-1165 Sat, 16 Sep 2006 23:12:00 +0000 http://www.terminally-incoherent.com/blog/2006/09/14/multiple-inheritance-in-java/#comment-1165

Ze, I added your comments to the post. Thansk :)

Reply  |  Quote
]]>
By: Luke http://www.terminally-incoherent.com/blog/2006/09/14/multiple-inheritance-in-java/#comment-1153 Fri, 15 Sep 2006 15:55:07 +0000 http://www.terminally-incoherent.com/blog/2006/09/14/multiple-inheritance-in-java/#comment-1153

Good point! I think this would work equally well, but you would probably end up writing more code to redirect the method calls. But the big advantage of your method is that you don’t need to change any of the code for Camera and Phone classes, so I think this would be a fair tradeoff.

Actually, what we probably should have is an interface for Camera and an inteface for Phone. Both classes would implement the appropriate one. Then CameraPhone would implement both, and simply redirect the methods to the objects declared inside. That would probably be the most elegant solution.

Reply  |  Quote
]]>
By: ZeWrestler http://www.terminally-incoherent.com/blog/2006/09/14/multiple-inheritance-in-java/#comment-1151 Fri, 15 Sep 2006 14:32:30 +0000 http://www.terminally-incoherent.com/blog/2006/09/14/multiple-inheritance-in-java/#comment-1151

I know its not the best solution, but what about declaring an object of both phone and camrea inside camreaphone. then have a bunch of accessor methods manipulating the variables for the 2 classes.

Reply  |  Quote
]]>