What is Object Oriented Programming ?

What is OOPs, Types of Programming, Benefits of OOPs , Principles, Basic Elements

Types of Programming:-

  1. Object Oriented

What is Object Oriented Programming?

Object oriented programming can be defined as a programming model which is based upon the concept of objects. Objects contain data in the form of attributes and code in the form of methods. It can be defined as a programming paradigm based on the concept of “objects”, which may contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods. For example, a person is an object which has certain properties such as height, gender, age, etc. It also has certain methods such as move, talk, and so on.

Languages used in Object Oriented Programming:

Java, C++, C#, Python , Ruby

What is Procedural Oriented Programming?

Procedural Programming can be defined as a programming model which is derived from structured programming, based upon the concept of calling procedure.

Languages used in Procedural Programming:

C , Pascal , Fortan etc.

What if Functional Programming Language?

Writing a program only in pure functions i.e never modify variables but only create new ones as an output.

Used in situations when we have to perform lots of different operations on the same set of data like ML.

One Programming language can be of all 3 types like-Python

Elements of Object Oriented Programming:

A class is an abstract blueprint used to create more specific, concrete objects. Classes often represent broad categories, like Car or Dog that share attributes.

These classes define what attributes an instance of this type will have, like color, but not the value of those attributes for a specific object.

Classes can also contain functions, called methods available only to objects of that type. These functions are defined within the class and perform some action helpful to that specific type of object.

For example, our Car class may have a method repaint that changes the color attribute of our car. This function is only helpful to objects of type Car, so we declare it within the Car class thus making it a method.

Benefits of OOPS:

  • OOP models complex things as reproducible, simple structures

Four Principles of OOP:

The four pillars of object oriented programming are:

  • Inheritance: child classes inherit data and behaviors from parent class

Conclusion:

In object-oriented (OO) programming, an application consists of a series of objects that ask services from each other. Each object is an instance of a class that contains a blueprint description of all the object’s characteristics.

Object-oriented programming revolves around the concept of an object, which encapsulates data and behavior acting on the data together. An object provides its services through a well-defined interface. This interface specifies “what” the object offers, abstracting “how” (actual implementation).

Hope you had a good learning experience! 👏

Student , AI Enthusiast