adsense


Wednesday, 25 November 2015

C++ LANGUAGE CLASS ACCESS MODIFIERS

COMPUTER LANGUAGES HTML,C,C++.JAVA,.NET AND MULTIMEDIA basics and programs click home button



C++ LANGUAGE CLASS ACCESS MODIFIERS






Class Access Modifiers 


Data hiding is one of the important features of Object 
Oriented Programming which allows preventing the functions 
of a program to access directly the internal representation 
of a class type. The access restriction to the class members 
is specified by the labeled public, private, and protected 
sections within the class body. The keywords public, private, 
and protected are called access specifiers. 

A class can have multiple public, protected, or private labeled 
sections. Each section remains in effect until either another 
section label or the closing right brace of the class body is seen. 
The default access for members and classes is private. 

class Base { 
  
   public: 
  
  // public members go here 
  
   protected: 
  
  // protected members go here 
  
   private: 
  
  // private members go here 
  
}; 


No comments: