Object-Oriented Programming (OOP)

Page content
  • It is a problem-solving approach, where all computations are carried out using objects.
  • It bundles related properties and behaviours into individual objects to structure a program.
    • An object may represent a person with properties like name, and behaviours like walking.
  • The program is divided into small parts called objects.
  • It follows a bottom-up approach.
  • It has access specifiers like private, public, protected, etc.
  • Adding new data and functions is easy.
  • It provides data hiding so it is more secure than procedural programming.
  • It allows overloading.
  • Data is more important than function.
  • It provides the ability to simulate the real world.
  • i.e. C++, Java, Python, C#, JavaScript, Ruby, PHP, VB.NE, etc.

Terminologies

Class

  • A class is a group of objects that share common properties and behaviour. It is a blueprint or template from which objects are created.

Object

  • Object is any real-world entity that can have some characteristics or which can perform some tasks. It is also called the instance of a class.

Ref