Abstraction
Abstraction is one of the four pillars of object-oriented programming. But what is it? In OOP it is a concept that allows us to create classes in a generic way so that they can be more easily re-used and is implemented through inheritance. Before we look at how to write an abstract class, let’s take a more general look at the concept of abstraction. Image: Abstraction is the 3rd pillar of OOP
Updated
General Abstraction
- Abstraction in Art (Novice): Abstraction means leaving out the details you don't need, shown through examples from art, math, language and the animal kingdom.
Abstraction in OOP
- Abstraction in OOP: an overview (Apprentice): Abstract classes take inheritance a step further, letting you write general classes whose properties and logic child classes share.
- Inheritance Review (Apprentice): A quick review of inheritance, using the Character and Archer classes, before we make a parent class abstract.
- Adding Abstraction (Journeyman): How to mark a class and its methods `abstract` so it can't be created on its own and every child class must fill in the missing methods.
- Summary (Journeyman): A recap of abstraction as an OOP idea and the `abstract` class as the Java tool that helps you reach it.