Inheritance in Java

As you’ve seen in the UML class relationships, there is the ability to define a class, and a subclass. The subclass will get all of the properties and methods of the parent class, and can then add additional properties and methods that are not available in the parent. Consider two classes, a Shape2D and a…