Skip to content
BENIBIX Learn

Object-Oriented Programming (OOP)

Development🧭 Programming ParadigmsObject-Oriented Programming

Also known as OOP, Object Oriented Programming, OO

Code built from objects. Each object holds its own data and actions.

Think of it like

Think of it like a toy box of robots. Each robot knows its own name and its own tricks.

Example

Jack's game has a Player class. Each of the four players is an object with its own name, score and move method.

Why it matters

Much of the code in big companies is built this way. Its words show up in every job interview.

Definition

Object-oriented programming builds programs out of objects. Each object holds its own data and the actions that use it. You write a class once, like a plan for a dog, then make many dogs from it. Objects talk by calling each other's methods. Four big ideas sit at its core: hiding data, sharing code, swapping parts and keeping things simple. Java, C# and Python all use it.

Common mistake

Making a class for each thing, even one small function. Not every idea needs to be an object.

Key takeaways

  1. 1
    Objects hold data. And the actions that use it.
  2. 2
    Classes are plans. Many objects from one class.
  3. 3
    Four core ideas. Hide, inherit, swap, simplify.

Compare