programplug Logo




C++ OOP Concept


C++ support object-oriented programming concept.In C++, we can easily create and use classes and objects.By using OOP's develop many applications.

Some Important concept of object-oriented programming are given below-

  • Class
  • Object
  • Method
  • Inheritance
  • Polymorphism
  • Data Abstraction
  • Encapsulation

Class

Class describe properties and method of an object.In other world class is a description of an object.Class is a blueprint or a set of instruction to build a specific type of object.

Syntax
class class_name
{
   field or data member or method
   field or data member or method
   field or data member or method
}

Object

Object is self-contained component which consists of methods and properties.In C++ is an object, and almost everything has attributes and methods.

Syntax
class_name object_name;

Method

Method is special kind of function that is associated with an object.Any object type can have methods.


Inheritance

It is a process by which object of one class aquire the properties or features of objects of another class.Inheritance is useful for "Reusability of codes".


Polymorphism

Polymorphism is made by two words "poly" and "morphs".Polymorphism means ability to take more than one form "Many Forms Of Data".The behaviour depends upon the types of data used in operations.


Data Abstraction

Abstraction is a process used to hide internal details and show only functionalities.


Encapsulation

Combining data and functions(method) into a single unit called class and the process is known as Encapsulation.Encapsulation is used to restrict access of methods and variables "Data Hidden".


#include    
class School 
{  
  public:  
  int id;     
  string name;    
};  
void main() 
{  
 School s;  //Calling 
 s.id = 1;    
 s.name = "Rahul";   
 cout<< s.id << endl;  
 cout<< s.name << endl;    
} 

output :
1
Rahul






Our Services

Developing Cheapest Websites
Offer Digital Marketing
Provide College Projects
Attractive Website Developing
Summer Training,Industrial Training
SCO,SMO

Contact Us

Dehradun Uttarakhand India
www.programplug.com
info@programplug.com
08534019974
Designed By : Mridul Gupta

Other Link

About Us

Contact Us

Disclaimer

Privacy Policy