0% found this document useful (0 votes)
14 views2 pages

The 3 Pillars of Object-Oriented Programming (OOP) Brought Down To Earth - Tech Elevator

The document explains the three major pillars of object-oriented programming (OOP): encapsulation, inheritance, and polymorphism. Encapsulation involves wrapping data and functions into a single object, inheritance allows for sharing features among related classes, and polymorphism enables treating different objects as instances of a common ancestor. The overview aims to simplify these concepts for programming students at Tech Elevator.

Uploaded by

syedirteza7860
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

The 3 Pillars of Object-Oriented Programming (OOP) Brought Down To Earth - Tech Elevator

The document explains the three major pillars of object-oriented programming (OOP): encapsulation, inheritance, and polymorphism. Encapsulation involves wrapping data and functions into a single object, inheritance allows for sharing features among related classes, and polymorphism enables treating different objects as instances of a common ancestor. The overview aims to simplify these concepts for programming students at Tech Elevator.

Uploaded by

syedirteza7860
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1/8/25, 10:30 PM The 3 Pillars of Object-Oriented Programming (OOP) Brought Down to Earth - Tech Elevator

plethora of programming tools can crowd out any memory of


the big concepts. The Bootcamps Hiring
following overview Workforce
originated duringDevelopment
a
review session I gave for both Java and C# students at Tech
Elevator to help remind them of the core pillars of object-
oriented programming. Keep Resources Aboutmore
reading to learn Us about Get Started
object-oriented programming and its three major pillars.

Object-Oriented Programming Explained

Object-oriented programming: Refers to the practice of


defining classes and objects to organize code, and is used in
most programming languages today. There are three major
pillars on which object-oriented programming relies:
encapsulation, inheritance, and polymorphism.

Phew! Even writing that makes my head spin. Students of


programming hear these terms, and learn lots of ways to use
them in their programming, but sometimes struggle to
understand what is what. Hopefully, this slide can bring the three
pillars down to earth and make them easier to remember.

If you are not familiar with the three pillars of OOP (object-
oriented programming), let me explain a bit more what the terms
mean, and what I mean by the slide.

https://www.techelevator.com/the-3-pillars-of-object-oriented-programming-oop-brought-down-to-earth/ 3/6
1/8/25, 10:30 PM The 3 Pillars of Object-Oriented Programming (OOP) Brought Down to Earth - Tech Elevator

1. Encapsulation: This is the idea of wrapping everything up


about a particularBootcamps
thing, whether Hiring
a Checking Workforce Development
Account or
Armadillo, into a defined object with features and behaviors.
Once we do, we can ask the object itself to do what it is
supposed to do, whether Resources About
that is Deposit MoneyUs or Defend
Get Started
Yourself. But nobody outside the object needs to worry about
how it does its jobs. We just tell it to do it and go about our
day. If everybody, and by this I mean every object, simply
minds its own business and stays out of the business of other
objects, all is good with the world.
2. Inheritance: This is the idea that we don’t have to define
absolutely everything about an object over and over again if
it shares features and behaviors with other objects. We can
define a class for Accounts and then let our Checking
Account or Savings Account inherit all the stuff in common.
Likewise, we can define a class for Animals, and let our
Armadillo inherit features like Number Of Legs and Weight as
well as behaviors such as Breathe and Sleep. We call these
overarching classes parent classes, and the ones that inherit
from them, child classes. We can then inherit from the child
classes and so on. But our Checking Account is more
specialized than our Accounts because we can Write A Check,
which we can’t do with a Savings Account. Our Armadillo can
Roll Into A Ball, but other animals such as a Giraffe don’t have
that behavior. Since we go from more general to more
specialized, I like to say that a child is like its parents, but
much more special.
3. Polymorphism: This fancy name just means that we can treat
the same object as different things depending on how we
need it at different times, and we can treat groups of different
objects that share an ancestor or trait as if they were that
ancestor or trait. So, we could have a set of different
Checking, Savings, and Credit Accounts and ask each to Get
Balance so we can figure out how much we have to spend on
vacation this year. Or we could ask a queue of animals to
Move Quickly, and not care how the Porpoise or Eagle or
Armadillo would handle that shared behavior. I like to think
that we are different things to different people, so even if not

https://www.techelevator.com/the-3-pillars-of-object-oriented-programming-oop-brought-down-to-earth/ 4/6

You might also like