Java Abstract Class and Methods with EXAMPLE
What is Abstract Class?
Abstract Classes are classes in Java, that declare one or more abstract methods.
Consider the following class hierarchy consisting of a Shape class which is inherited by three classes Rectangle, Circle, and Triangle. The Shape class is created to save on common attributes and methods shared by the three classes Rectangle, Circle, and Triangle. calculateArea() is one such method shared by all three child classes and present in Shape class.
In this tutorial, you will learn-