Object-oriented programming

Metadata
aliases: [OOP]
shorthands: {}
created: 2022-01-20 11:49:26
modified: 2022-06-26 21:34:35

Object-orientation

A software engineering concept in which concepts are represented as objects related elements organized together

Object

Can contain data and code:

Classes

Most OOP languages are class-based: objects are instances of classes, which also determine their types.

The class is the definition of the data format and available procedures. It may also contain data and procedures itself (class methods (static in C++)).

Shared features with non OOP languages

Encapsulation

Classes can have private and public field and methods. The private members cannot be accessed from outside the class.

Inheritance

Classes can be arranged in a hierarchy that represents "is-a-type-of" relationships.

For example: the class Dog extends the class Animal

Examples