Composition

Mark Dalrymple, Scott Knaster · Apress eBooks · 2009

In the previous chapter, you got hip to inheritance, a way to set up a relationship between two classes that removes the need for a lot of duplicated code. And we (briefly) mentioned that you can also set up relationships using composition, which is the subject of this chapter. You can use composition to combine objects so they can work together. In a typical program, you’ll use both inheritance and composition when creating your own classes, so it’s important to have a good handle on both concepts.

Cited by 0 works. doi:10.1007/978-1-4302-1816-6_5

Authors