Object Oriented Programming
The basic terms of object oriented programming, explained clearly for beginners.
Last updated: September 1, 2026
Basic terms
ClassA blueprint that describes which properties and abilities something hasObjectA concrete instance of a class, created from its blueprintAttributeA property of an object, like name or ageMethodA function that belongs to a class and lets objects do somethingConstructorA special method that runs when an object is createdThe four core principles
EncapsulationHiding an object's internal details from the outside, only accessible through methodsInheritanceA class takes on properties and methods of another classPolymorphismDifferent classes react differently to the same method callAbstractionOnly showing the important details, unimportant details are hiddenExample in Java
class Car { }Defines a new class called Carprivate String color;A private attribute, only directly accessible within the classpublic Car(String color) { ... }The constructor, sets the color when creatednew Car("Red");Creates a new object of the class CarMore terms
InterfaceDictates which methods a class must have, without implementing them itselfInheritance hierarchyThe chain of parent and child classes that pass properties downthisRefers within a class to the current object itselfWorth a look
Inheritance between classes
A subclass automatically inherits attributes and methods from its parent class.
Vehicle (parent class)
Car
Motorcycle
Car and Motorcycle inherit from Vehicle, but can additionally have their own methods.