Inheritance allows one class to represent many different types of objects in what's called polymorphism. A Shape class can represent different subclasses, such as Line, Circle, Square, and others. A drawing application can loop through all Shape objects (regardless of their subclasses) and execute a paint() method to paint them on the screen or the program canvas without having to deal with each class separately.
Since the Shape class has the paint() method and each of its subclasses has its own implementation of it, it becomes much easier for the application to just execute the paint() method, regardless of its implementation.