Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Inheritance in c++

13.606 Aufrufe

Veröffentlicht am

www.cppforschool.com tutorial on inheritance in C++

Veröffentlicht in: Bildung
  • Loggen Sie sich ein, um Kommentare anzuzeigen.

Inheritance in c++

  1. 1. INHERITANCE IN C++<br /> <br />FREE DOWNLOAD<br />CBSE Question Papers, C++ Projects, <br />C++ Practical Questions & Answers , C++ Tutorial<br />http://www.cppforschool.com<br /> <br />
  2. 2. INHERITANCE IN C++<br />Inheritance :<br />It is the capability of one class to inherit properties from another class.<br />Base Class:<br />It is the class whose properties are inherited by another class. It is also called Super Class.<br />Derived Class:<br />It is the class that inherit properties from base class(es).It is also called Sub Class.<br />
  3. 3. FORMS OF INHERITANCE<br />Single Inheritance:<br />It is the inheritance hierarchy wherein one derived class inherits from one base class.<br />Multiple Inheritance:<br />It is the inheritance hierarchy wherein one derived class inherits from multiple base class(es)<br />Hierarchical Inheritance:<br />It is the inheritance hierarchy wherein multiple subclasses inherits from one base class.<br />Multilevel Inheritance:<br />It is the inheritance hierarchy wherein subclass acts as a base class for other classes.<br />Hybrid Inheritance:<br />The inheritance hierarchy that reflects any legal combination of other four types of inheritance.<br />
  4. 4. FORMS OF INHERITANCE<br />
  5. 5. Visibility Mode<br /> It is the keyword that controls the visibility and availability of inherited base class members in the derived class. It can be either private or protected or public.<br />Private Inheritance:<br />It is the inheritance facilitated by private visibility mode. In private inheritance, the protected and public members of base class become private members of the derived class.<br />Public Inheritance:<br />It is the inheritance facilitated by public visibility mode. In public inheritance, the protected  members of base class become protected members of the derived class and public members of the base class become public members of derived class.;<br />Protected Inheritance:<br />It is the inheritance facilitated by protected visibility mode. In protected inheritance , the protected and public members of base class become protected members of the derived class.<br />
  6. 6.
  7. 7. Execution of base class constructor<br />When both derived and base class contains constructors, the base constructor is executed first and then the constructor in the derived class is executed.  In case of multiple inheritances, the base classes are constructed in the order in which they appear in the declaration of the derived class.<br />
  8. 8.  <br />FREE DOWNLOAD<br />CBSE Question PapersC++ ProjectsC++ Practical Questions & AnswersC++ Tutorials<br />http://www.cppforschool.com<br /> <br />

×