Kotlin Abstract Class With Examples

What are Abstract Classes ? A class that cannot be instantiated i.e. we cannot create the objects of an abstract class. Generally used as a parent class that defines the common protocol for the child classes. What are Abstract Methods? Abstract methods are those methods that do not have a body. These methods can only be defined inside an abstract class i.e. if you mark the method as abstract, you need to mark that class as abstract. Let's understand this with an example - Suppose, we have this class hierarchy and we need to display these shapes and there is a method to calculate the area of these shape objects. We know how to display a square, a circle, or a triangle. But what about shape? If we define a shape class as a normal class - we can also create an instance of this Shape class. But there is a problem here. We don't know how a Shape looks like and we cannot even calculate its area because we don't know how it looks. So does it make sense to allow users to create a