The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
September 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


RE multiple implementation inheritance

Posted by Kishori Sharan on September 14, 2000 at 10:14 PM

Hi Abha

"Although class A extends B,C,D{} is a No-no in Java; you can
use Inner Classes to do that."
In the above line you are saying you can use inner classes to get all the functionalities of multiple inheritance. But Dinesh's question is , "can he inherit class A from class B, C and D" and you are saying you can do it using inner classes which is not true. What he wants to achieve or will achieve using multiple inheritance where class A inherits class B, C and D, cannot be achieved just by using inner classes. Inhertance defines "is a" relationship. Now I am curious to see inner classes implementing "is a" relationship in Dinesh's case. Of course, inner classes gives you some kinda conveniece in coding some particular situtions, but is in no way a substitue or "a complete solution of the multiple inheritance". Even BruceEckel has said in his book , "So one way to look at the inner class is as the completion of the solution of the multiple-inheritance problem ( page 388 Thinking in Java 2nd edition )". What he meant to say is it can be thought as a part of the multiple-inheritance not the complete solution itself. I think you misread this line and thought inner classes as a complete solution to multiple inheritance.



Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us