Object-oriented programming in Java.
With composition or inheritance you can place sub-objects inside your new class. If you do this explicitly than you are using composition otherwise if you do this implicitly, you are using inheritance. I will outline the difference between the two below as well as point out one of the key design patterns to use in your development. Prefer composition vs inheritance.
Composition is used when you want the features of an existing class to be included inside your new class, but not be