Home » Expert's columns

Concepts of Object Oriented Programming System (OOPS)

In this article, we are going to learn about the Object Oriented Programming System (OOPS) in C++ programming language.
Submitted by Brajesh Kumar Shrivash, on March 15, 2018

The basic concepts of object oriented programming are:

  1. Object
  2. Class
  3. Inheritance
  4. Data Abstraction
  5. Data Encapsulation
  6. Polymorphism


An object is an instance of a class. Object is one of the basic elements of OOP’s; it is most significant unit as without creating object, we cannot access the functionality of the class. After defining the class, we create its object to get accessibility of data member and member functions of respective class.

Below mentioned is an example of how to create an object?


class_name object_name

It is very easy to create an object of a pre-defined class. To create the object, we need to write the name of the class first then name of the object. User can put the name of object as per their choice.

For example: we are assuming that the student class is already exists and we can create its object like in this way,

student s;   //s is an object of class student

We can create more than one object of a class. For example,

student s,s1,s2,s3;


Class is a user define data type; we call it user define because a user can define the data and functions as per their requirements. To create a class, we first write class (class is a keyword) and then name of the class (mentioned below in example). Basically class divides in two main sections - data member and member function. Class is a unit which combines data member and member function together in a single unit.


    class class_name
      //data members section
      // member functions section


#include <iostream>
using namespace std;

class student
		//sname and srollno are data members
		char sname [30];
		int    srollno;

			void getinput()
				// get name from the Keyboard 
				cout<<"Input Students Name: ";  
				// get rollno from the Keyboard
				cout<<"Input Students Roll Number: ";
			void getoutput()
				// shows name on monitor
				cout<<"Students Name:"<< sname << endl;     
				// shows rollno on monitor
				cout<<"Student Roll Number:"<<srollno<< endl;   

//main code
int main()
	// s is an object of student class
	student s;                  

	// the getinput method is being called
	// the getoutput method is being called
	return 0;


Input Students Name: DUGGU 
Input Students Roll Number: 101 
Students Name:DUGGU
Student Roll Number:101

Comments and Discussions!

Copyright © 2023 www.includehelp.com. All rights reserved.