Chapter 26. Introducing Extensions
An extension is the addition of a class, an interface, or a method to an existing code base. The most common way to extend code is to write a new class, although you can also extend a class through delegation. In particular, when you'd like to subclass from two parents, you can subclass from one parent and use delegation to “inherit” the behavior of the other class.
Object-oriented development in Java does not begin from scratch. Rather, it's fair to say that object-oriented software development is extension. To develop in Java, learn what is available in an existing code base, including a company's code and the Java class libraries. After seeing where your changes fit in, add the code you need for your application. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access