Extending a class

Extending classes can be used to allow for new behaviors, while adhering to common interfaces. While it's not always the best way to organize relationships between objects, there are many situations where extension (sometimes called inheritance) is the most effective way to structure behavior.

In this recipe, we'll see a very simple example of extension.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.59.36