TheFreeSite.com!

Monday, July 28, 2008

Chapter 6: Reusing classes

The concept of inheritance is standard in virtually all OOP languages. It’s a way to
take an existing class and add to its functionality (as well as change it, the subject of
Chapter 7). Inheritance is often a way to reuse code by leaving the “base class” the
same, and just patching things here and there to produce what you want. However,
inheritance isn’t the only way to make new classes from existing ones. You can also
embed an object inside your new class with composition. In this chapter you’ll learn
about these two ways to reuse code in Java, and how to apply them.

0 comments:

Tell Me Doubts In Java