Intro to Object Oriented Programming

Object Oriented Programming or OOP refers to langauges that uses objects in programming.
The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function

Class is a blueprint for creating particular data structures, providing initial values for state, and implemntations of behavior.

Object is an instance of a class which has the structure of its blueprint but also owns its unique state and behavior.

Encapsulation is achieved when each object keeps its state private, inside a class.
Other objects don't have direct access to this state.

Abstraction means that each object should only expose a high-level mechanism for using it.
This mechanism should hide internal implementation details.

Objects are often similar. They share common logic.
With inheritance, the child class reuses all fields and methods of the parent class and can implement its own.

Polymorphism means "many shapes". It gives a way to use a class exactly like its parent, but each child class keeps its own methods as they are.