?
Solved

difference between class inheritance and composition

Posted on 1998-11-19
2
Medium Priority
?
1,144 Views
Last Modified: 2008-02-20
what is the different between class Inheritance and composistion ? and When would I choose the former over the later ?
0
Comment
Question by:anhben
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Expert Comment

by:msmolyak
ID: 1227860
The following book has an entire chapter (very well written too) dedicated to this subject:

Java Design : Building Better Apps and Applets (Yourdon Press Computing Series), 1st Edition by Peter Coad, Mark Mayfield, Pete Coad

It gives you the rules on when to use inheritance and when to use composition instead.
0
 
LVL 5

Accepted Solution

by:
fontaine earned 100 total points
ID: 1227861
In the November issue of the Javaworld on-line magazine, there is a 2500 words article
entitled...

"Inheritance versus composition: Which one should you choose? "

This is exacly what you need! Here is the URL:

http://www.javaworld.com/javaworld/jw-11-1998/jw-11-techniques.html
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question