Course Content
C++ Introduction
0/1
C++ Variables & Constants
0/1
C++Scope of Variable
0/1
C++ Keywords & Identifiers
0/1
C++ Data Types
0/1
C++ Basic I/O
0/1
C++ Type Conversion
0/1
C++ Operators
0/1
C++ Comments
0/1
C++ If-else
0/1
C++ Ternary Operator
0/1
C++ for Loop
0/1
C++ Ranged for Loop
0/1
C++ while/do-while Loop
0/1
C++ break Statement
0/1
C++ Continue Statement
0/1
C++ switch Statement
0/1
C++ goto Statement
0/1
C++ Functions
0/1
C++ User-defined Functions
0/1
C++ Default Arguments
0/1
C++ Storage Class
0/1
C++ Recursion
0/1
C++ Return by Reference
0/1
C++ Arrays
0/1
C++ Multi-dimentional Arrays
0/1
C++ Arrays & Function
0/1
C++ String
0/1
C++ Structure
0/1
C++ Structure & Functions
0/1
C++ Pointers to Structure
0/1
C++ Pointers
0/1
C++ Void Pointers
0/1
C++ Pointers & Arrays
0/1
C++ Pointers & Functions
0/1
C++ Dynamic Memory Allocation
0/1
C++ OOPs Concepts
0/1
C++ Objects and Class
0/1
C++ Constructors
0/1
C++ Destructors
0/1
C++ Constructor Overloading
0/1
C++ Objects & Function
0/1
C++ Enumeration
0/1
C++ Inheritance
0/1
C++ Inheritance Access Control
0/1
C++ Inheritance Types
0/1
C++ Polymorphism
0/1
C++ Function Overloading
0/1
C++ Function Overriding
0/1
C++ Operator Overloading
0/1
C++ Friend Function
0/1
C++ Virtual Function
0/1
C++ Abstract Class & Pure Virtual Function
0/1
C++ Encapsulation
0/1
C++ Abstraction
0/1
C++ Templates
0/1
C++ Exception Handling
0/1
C++ Multithreading
0/1
C++ Standard Library
0/1
C++ Programming Tutorials
About Lesson

C++ OOPs Concepts

In this tutorial, we will learn Object Oriented Programming Concepts. A pattern that avails many concepts like polymorphism, inheritance, data binding etc. is known as the object Oriented Programming.


What is OOP?

OOP stands for Object-Oriented Programming.
Object Oriented Programming (OOP) is commonly used when writing code with C++. It is a concept used in many other programming languages as well and it is important for all programmers to understand.

Object Oriented Programming is a programming paradigm that uses the concepts of objects and classes. It is a standard in programming that is used to solve a specific type of problem. OOP is a way to structure a program using reusable pieces of code (called classes) which can be used to create individual instances of objects.


Key-points and Features of Object Oriented Programming:

1. It emphasis more on data rather than procedure.
2. The programs are divided into objects thus making it easy to work with.
3. Data structures are designed in such a way that they characterize the objects.
4. Functions that work on the data of an object are placed together in the data structure.
5. Data is hidden and cannot be accessed by external functions without permission.
6. Communication between objects can take place with the help of functions.
7. Adding new data and functions has become easy.
8. Follows the bottom-up approach in program design.


OOPs (Object Oriented Programming System)

An object simply means an entity of the real word like lunch, phone, bike etc. Object Oriented Programming is basically known to be a pattern that is used to design a program just by the use of objects and classes.

This programming method in C++ generally simplifies the software development and the maintenance by providing some basic concepts that are as follows:

  • Class
  • Objects
  • Inheritance
  • Polymorphism
  • Abstraction
  • Encapsulation
  • Exception Handling

1. Class

A class is basically a logical entity and mainly a collection of objects.

It is similar to structures in C language. Class can also be defined as user defined data type but it also contains functions in it. So, class is basically a blueprint for object. It declare & defines what data variables the object will have and what operations can be performed on the class’s object.


2. Object

Objects are the basic unit of OOP. They are instances of class, which have data members and uses various member functions to perform tasks.

Object is basically anything that possesses state and behavior and can be either physical or logical. For example: phone, purse, bike etc.


3. Inheritance

The things or the properties and behaviors are generally acquired by one object from its parent object is known to be the inheritance. It enhances the code reusability and in order to achieve runtime of polymorphism.


4. Polymorphism

Polymorphism is the process where one task gets performed by various ways. In order to achieve the polymorphism in C++ , function overloading and function overriding is used.


5. Abstraction

Abstraction is generally known as the process of hiding internal details and displaying the functionality. Abstract class and interface is used to get the abstraction in C++.


6. Encapsulation

Encapsulation is basically binding or wrapping the code and the data into a single unit.

Binding (or wrapping) code and data together into a single unit is known as encapsulation. For example: capsule, it is wrapped with different medicines.


7. Exception Handling

Exception handling is a feature of OOP, to handle unresolved exceptions or errors produced at runtime.


Advantage of OOPs over Procedure-oriented Programming Language

1. OOP is faster and easier to execute.
2. OOP provides a clear structure for the programs.
3. OOP helps to keep the C++ code DRY “Don’t Repeat Yourself”, and makes the code easier to maintain, modify and debug.
4. OOP makes it possible to create full reusable applications with less code and shorter development time.

Exercise Files
No Attachment Found
No Attachment Found
error: Content is protected !!