Object Oriented Programming explained in a simple way

What is meant by Object Oriented Programming? Explain the features that qualify a Programming Language as OOP and what are they.

Object-Oriented Programming (shortly called OOP) is a programming pattern. When you’re trying build components and programs that are basically instructions to do something, you’d create them using different patterns or paradigms.

Broadly speaking, there are two types of paradigms – Procedure Oriented Programming and Object Oriented Programming.

Examples of Procedure Oriented Programming include C, BASIC, COBOL and all the early programming languages created to write instructions and build applications.

What is meant by Object Oriented Programming?

Object Oriented Programming paradigm (OOP) focuses on organizing code around classes and objects, with classes being the logical structures that wrap functionality and data together and objects being the physical representation of a class in the memory.

There are four main features that any Object Oriented Programming language follows and users can apply. These are as follows –

Encapsulation

Encapsulation is a mechanism of wrapping up the data and code together as a single unit.

It can also be stated as hiding entities which are not required for the context. In other words, it means to deny access to those features or contents which aren’t needed for the other components to get hold of.

The requesting component need not know all the details of the component it is requesting, it just needs to be informed of only things it requires to get things done.

In Java, C# or any other OOP language you can achieve encapsulation by use of Classes and Objects.

Inheritance

Inheritance is a process where one class acquires the properties of another. It is when a class or an object can access all the data and functionalities from another class by making itself a derivative of the other class.

The class which is the original source of information and functionality is called as a base class or a super class. The class which marks itself as a derivative of the former is called as a derived class, child class or a sub class.

Abstraction

Abstraction is the methodology of hiding the implementation details from the user and only providing the functionality to the users.

It enforces providing access to those features or contents which are needed for the moment. The client or the requesting component need not know all the details of the component it is requesting, it just needs to be informed of only things it requires to get things done. You’d implement this using access specifiers and abstract classes.

Polymorphism

Polymorphism is the ability of a variable, function or object to take multiple forms. This is a scenario among base and derived types.

A base type can be used to invoke a method of its derived type, which is in contrast to the behavior of Inheritance where a derived type accesses its base type methods. These bindings, to call which method from which type – is resolved either at compile time or run time, which means conceptually, there are two types of Polymorphism.


Buy Me A Coffee

Found this article helpful? Please consider supporting!

Ram
Ram

I'm a full-stack developer and a software enthusiast who likes to play around with cloud and tech stack out of curiosity. You can connect with me on Medium, Twitter or LinkedIn.

Leave a Reply

Your email address will not be published. Required fields are marked *