Abstraction: Abstract Classes and Abstract Methods
We have now covered three major pillars of Object-Oriented Programming: Encapsulation, Inheritance, and Polymorphism. The final pillar we will discuss is Abstraction.
We have now covered three major pillars of Object-Oriented Programming: Encapsulation, Inheritance, and Polymorphism. The final pillar we will discuss is Abstraction.
In Object-Oriented Programming, an interface is a description of the actions an object can do. It's a contract or a blueprint that defines a set of methods that a class must implement. For example, any object that acts as a "Data Parser" should have a .parse() method, regardless of whether it's parsing a PDF, a website, or a text file.