The Artima Developer Community

Legacy Design Forum
Composition Versus Inheritance

Advertisement

Advertisement

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

Message:

Relationship

Posted by Kelly Kow on March 03, 2001 at 10:20 PM

I have a question about relationship between classes and objects.
If car "is-a" vehicles, and car "has-a" engine. Does that mean, car is "a-kind-of" vehicle,
and engine is "part-of" car?
How do we differentiate these relationship using code?



Replies:

Sponsored Links




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