I am trying to understand the definition of 'abstraction' in OOP.

I have come across a few main definitions. Are they all valid? Is one of them wrong? I'm confused. (I re-wrote the definition with my own words).

Definition 1:

Abstraction is the concept of taking some object from the real world, and converting it to programming terms. Such as creating a Human class and giving it int health, int age, String name, etc. properties, and eat() etc. methods.

Definition 2:

A more general definition. Abstraction is a concept that takes place anywhere in a software system where 'making things more general/simpler/abstract' is involved. A few examples:

  • An inheritance hierarchy, where the higher classes are simpler or more general, and define more general and abstract implementation. While the lower classes in the hierarchy are more concrete and define more detailed implementations.

  • Using encapsulation to hide the details of implementation of a class from other classes, thus making the class more 'abstract' (simpler) to the outside software world.

Definition 3

Another general definition: Abstraction is the concept of moving the focus from the details and concrete implementation of things, to the types of things (i.e. classes), the operations available (i.e. methods), etc, thus making the programming simpler, more general, and more abstract. (This can take place anywhere and in any context in the software system). It takes place for example when encapsulating, because encapsulation means to hide the details of implementation and only show the types of things and their more general and abstract definitions. Anotehr example would be using a List object in Java. this object actually uses the implementation details of an ArrayList or a LinkedList, but this information is abstracted using the more general name List.

Is any of these definitions correct? (I am referring to the most conventional and accepted definition).

  • Abstraction is defining a "thing" to be a certain TYPE of thing (Animal => Dog) in order to narrow it down even further (Dog => Poodle).
    – Christine
    Commented Jul 5, 2016 at 17:45
  • Definitions are never absolutely correct or incorrect. Language is complicated and fuzzy, definitions are descriptions of how words are used but they are always by necessity incomplete and inexact. It's make more sense to ask if a definition is helpful or unhelpful rather than correct or incorrect.
    – bdsl
    Commented Aug 4, 2021 at 20:35

3 Answers 3


Abstraction is one of the 4 pillars of Object Oriented Programming(OOP). It literally means to perceive an entity in a system or context from a particular perspective. We take out unnecessary details and only focus on aspects that are necessary to that context or system under consideration.

Here is some good explanation:

You as a person have different relationships in different roles. When you are at school, then you are a "Student". When you are at work, you are an "Employee". When you are at government institution, you can be viewed as a "Citizen". So it boils down to what in what context are we looking at an entity/object. So if I am modelling a Payroll System, I will look at you as an Employee(PRN, Full Time/Part Time, Designation). If am modelling a Course Enrollment System, then I will consider your aspects and characteristics as a Student(Roll Number, Age, Gender, Course Enrolled). And if I am modelling a Social Security Information System then I will look at your details as a Citizen(like DOB, Gender, Country Of Birth, etc.)

Remember that Abstraction(focussing on necessary details) is different from Encapsulation(hiding details from the outer world). Encapsulation means hiding the details of the object and providing a decent interface for the entities in outer world to interact with that object or entity. For example, if someone want to know my name then he cannot directly access my brain cells to get to know what is my name. Instead that person will either ask my name. If a driver wants to speed up a vehicle then there is an interface(accelerator pedal, gear, etc) for that purpose.

The 1st def s not very clear. Def 2 is good but it tends to confuse the newbie as it tries to link Abstraction with Encapsulation and Inheritance. Def 3 is the best one out of 3 definitions as it clearly defines what is Abstraction precisely.

  • 3
    So you would say that it's like a generalization instead of a specification?
    – Robert
    Commented Jan 6, 2015 at 0:50
  • 1
    @samyismyhero Exactly! We look for generic attributes and behavior of objects for abstraction.
    – Maxood
    Commented Jan 7, 2015 at 7:41
  • [Animal => Dog] is an abstraction. You define what possible parts an "Animal" can have to create a "Dog." (Tail, legs, fur, etc). Then, you can use the "Dog" class to define a Poodle, Pit Bull, etc. So, you're declaring dog breeds based on the "Dog" class instead of an "Animal."
    – Christine
    Commented Jul 5, 2016 at 17:49
  • 2
    There are 4 pillars in OOP
    – AliN11
    Commented May 7, 2021 at 10:58
  • Thank you for rectifying me.
    – Maxood
    Commented Aug 4, 2021 at 19:54

Each of these definitions is fine.

Abstraction is where you focus on only those details that are important for your purpose.

In the first case, you (at present) cannot include real people in your code; you focus on particular details of a person that serve your purpose. In another program you may need to focus on different details. These would be different abstractions of a person, and each can be equally valid in their context.

The second and third definitions continue this idea, applying it to software entities.


Definition 1 is definitely not an abstraction. That is more closely describing modeling.

Definitions 2 and 3 describe same thing. And both are pretty good descriptions of an abstraction.

  • That's what I thought! abstract class Shape lol!
    – Robert
    Commented Jan 6, 2015 at 0:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.