Object Oriented Programming(OOPS) in C++

There are two common programming methods:

  1. Procedural programming
  2. Object-oriented programming (OOP)

1 Procedural Programming

2 Object-Oriented Programming

3 The difference between Object-Oriented Programming(OOPS) and procedural programming are :

4 The basic concept of OOPS

4.1 Object

4.2 Classes

5 Features of Object-Oriented Programming(OOPS)

5.1 Data Abstraction:

5.2 Encapsulation:

5.3 Modularity:

5.4 Inheritance:

5.5 Polymorphism:

6 ADVANTAGES OF OOPS

7 DISADVANTAGES OF OOPS

7.1 Related Posts

Procedural Programming

A program in a procedural language is a list of instructions, which are followed step by step.
In a procedural paradigm, the emphasis is on doing things. Also, in this, data types are used and worked upon by many functions. Any change made by function to a data type is reflected in all locations of function.
Lastly, it does not model the real world very well.

Object-Oriented Programming

  • C++is known as the extension of C because it contains the features of OOPS.
  • OOPS stands for Object-OrientedProgramming. It offers a real-world relationship.
  • It is a programming paradigm based on the concept of OBJECTS that contains data and methods.
  • It offers a new and powerful way to cope up with bugfree , easy to maintain and reusable programs.

The basic concept of OOPS

Before the discussion of the basic concepts, we should know what does an object and a class mean.

Object

An object is an identifiable piece of code with some characteristics and behavior. Just look around you, the book you are reading, the pen.
You are writing with are all objects.

Classes

A class is a group of objects that share common properties and relationships. For example, fruits is a class whereas orange, litchi are the Objects respectively.

Features of Object-Oriented Programming(OOPS)

Data Abstraction:

It is defined as the act of representing essential features without including background details. For example: While driving a car, you are only in contact of its outer features like gear handling, accelerator, brakes, etc. You don’t have to worry about its internal connections like wiring, motor working i.e, they are hidden/abstracted from you.

Encapsulation:

It is the most fundamental concept in oops. The wrapping up of data and operations/functions (that operates on data) into a single unit (called class) is known as encapsulation. A class describes encapsulation.

Abstraction and Encapsulation are complementary concepts. Encapsulation is a way to implement data abstraction. You will understand more about it in classes

Modularity:

Modularity is the property of a syste that has been decomposed into a set of cohesive and loosely coupled modules. It is required in a program because

  • It reduces program complexity to some degree.
  • It creates a number of well- defined, documented boundaries within the program.

Let us take the example of a computer system. The music system comprises speakers, monitors, printers, etc.Thus these are the modules for the System.

Inheritance:

It is defined as the capability of one class of things to inherit capabilities or properties from another class. As In the class car inherits some of its properties from class automobiles which inherits some properties from class vehicle.

Polymorphism:

It is defined as the ability for a message or data to be processed in more than one form.

ADVANTAGES OF OOPS

  • Re-use of code.
  • Ease of comprehension.
  • Ease of fabrication and maintenance.
  • Easy redesign and extension.

DISADVANTAGES OF OOPS

  • With OOPs, classes tend to be overly generalized.
  • The relations among classes become artificial at times.
  • The OOP program design is tricky.
  • To program with OOP, The programmer needs proper skills, thinking, etc.

Hope so, you would like my post, Please follow me on  my profile @priya123 to get latest post Developed by me.

Related Posts

  • Wrapper class in javaTo make java fully object-oriented, wrapper Class was introduced. It is used to convert a primitive data type into an object and vice versa. A…
  • Introduction To Java ProgrammingEvolution Of Programming Language Fortran(Assembler Based), a formula translation was developed in 1957.Algol (Assembler Based), algorithm based was developed in 1960.BCPL (Assembler Based), basic combine…
  • Understanding the Programming language Concept with exampleUNDERSTANDING PROGRAMMING Let’s take a look at our very first program and discuss all the things about it: // first program #include <iostream.h> int main()…
  • Practical Application of Python Programming LanguageThere are lots of practical application of python programming language in variety of field such as Internet Of Things(IOT), web development, machine learning and list…
  • Basics of C++ Programming Language BASICS Just like all languages c++ also have a well-maintained set of characters, symbols, integers, etc. CHARACTER SET It is defined as a set of…