1. Introduction

Introduction to C++

C++ is a general-purpose programming language that was developed as an enhancement of the C language to include object-oriented paradigm. It is an imperative and a compiled language.

Difference between Procedural Programming and Object Oriented Programming:-


Concepts of Oops:-
Object Oriented programming is a programming style that is associated with the concept of Class, Objects and various other concepts revolving around these two, like Inheritance, Polymorphism, Abstraction, Encapsulation etc.
1). Class

 A class is a blueprint for any functional entity which defines its properties and its functions. Class can also be defined as user defined data type but it also contains functions in it. 

2). Objects

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

3).Inheritance

Inheritance is a way to reuse once written code again and again. The class which is inherited is called the Base class & the class which inherits is called the Derived class. They are also called parent and child class.

4).Abstraction

Abstraction refers to showing only the essential features of the application and hiding the details. In C++, classes can provide methods to the outside world to access & use the data variables, keeping the variables hidden from direct access, or classes can even declare everything accessible to everyone, or maybe just to the classes inheriting it.

5). Encapsulation

It can also be said data binding. Encapsulation is all about binding the data variables and functions together in class.

6). Polymorphism

It is a feature, which lets us create functions with same name but different arguments, which will perform different actions.

7). Exception Handling

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

Characteristic of Oops:-


Addvantage of Oops:-

1. Less Complex- As the number of arguments increase in function oriented programming (like in C) it create confusions and making the code more complex for any new user to understand.

2. Data Binding- Bind data and functions into a single unit i.e class.

3.Real life application Solving

4.Reusability

5.Data Redundancy:- Inheritance is the good feature for data redundancy if you need a same functionality in multiple class you can write a common class for the same functionality and inherit that class to sub class.

6.Easy Maintenance










Post a Comment

0 Comments