The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
June 2000

Advertisement

Advertisement

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.

Message:

multiple iheritance

Posted by soundar on June 16, 2000 at 2:01 PM

> if not removed totally .........but why?

We need to take a small example with some classes.

A
/ \
/ \
B C
\ /
\ /
D

Let's consider this simple example where B and C inherit from A and D inherits from B&c (typical combination of C++'s hierarchical and multiple inheritance). For this discussion let's not consider the hierarchical inheritance. Consider the multiple inheritanace, if the child class D has to get a handle of grandparent, A, then, it can achieve it through two ways viz.,

one of its parent B and through
another parent C

Now, D has a duplicate reference to access its grandparent A, just in order to avoid this chaos.....

Hope you got it






Replies:

Sponsored Links



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