12th Computer Science BCA CBSE JAC

Concept of Object Oriented Programming in C++

Concept of Object Oriented Programming in C++
Written by AIPS

In this topic we will learn best Concept of Object Oriented Programming in C++.

Object Oriented Programming (OOP) is way of programming that allows modularization of a program by forming separate memory area for data as well as function.

There are following characteristics of Object Oriented Programming.

  • Programs are divided into class and objects
  • New data items and function can be easily added whenever essential.
  • Data is private and prevented from accessing external functions.
  • OOP pays more importance to data than function.
  • Object can communicate with each other through functions.

Advantages of OOP:

Object Oriented Program can be easily upgraded without affecting the other parts of the program.

Redundant program code can be eliminated using inheritance.

OOP allows Po;ymorphism, Encapsulatioin, and other characteristics of OOP.

OOP enhances the thought process of a programmer to rapid development of a software in sort time.

Uses of OOP:

  • Object oriented DBMS / Application software
  • System software
  • Office automation software / custom software
  • Network Programming
  • Computer Aided Design(CAD) /Computer Aided Manufacturing(CAM)

Example of OOP Language

  • Simula67
  • C++
  • Small talk
  • Charm++
  • Java
  • C# (C Sharp)

What is Class ?

  • Class is a user Defined Data type.
  • A Class is a group of similar objects that can share common properties and relationship.
  • A class serve as a blue print or template for its objects. i.e any number of objects can be created for a class.
  • A class represents the data as well as functions. For example a class computer consists of data such as keyboard, Monitor, Price, Brand etc. In addition it also consists functions such as Processing(), Display(), Printing() etc .i.e specified action that can taken on data.
  • Class does not exists physically.

Object

  • An object is a runtime entities.
  • Objects are small self contained modular units with a well defined boundary.
  • Object is like a variable of type class.
  • An object consists of state and behavior.

Method / Function

An operation required for an object when coded in a class is called method.

Data Abstraction

The representation of essential feature without including the background details, is called data abstraction.

Abstraction is a mechanism or technique to hide irrelevant (unwanted) details and representation of only essential feature so that one can focus on important thing at a time. For example while driving a car a driver knows only essential feature such as how to use the clutch, gears, break , accelerator etc.

Polymorphism

The capability of taking more than one form for different purpose is called polymorphism.

Polymorphism allows the same function to act differently.

It is a greek term which means multiple forms.

example: Function overloading , Operator overloading.

Encapsulation

The packing of data and function into a single component is known as encapsulation.

Inheritance

It is the method by which object of one class gets the properties of objects of another class.

Inheritance is one of the most powerful feature of OOP language that allows to derive a new class from existing class.

Data Hiding

It means declaring data members and member functions in private section so that it can’t be accessed directly outside of the class.

About the author

AIPS

Leave a Comment