Object-Oriented Programming C++inheritance types of inheritanceexampple program .pptx
kavirajee
14 views
11 slides
May 01, 2024
Slide 1 of 11
1
2
3
4
5
6
7
8
9
10
11
About This Presentation
Object-Oriented Programming C++inheritance types of inheritanceexampple program
Size: 363.87 KB
Language: en
Added: May 01, 2024
Slides: 11 pages
Slide Content
UNIT-III Prepared by R.RAJESWARI Assistant Professor in IT Dept S.B.K.COLLEGE Object-Oriented Programming C++
Inheritance class derived-class-name : visibility-mode base-class-name { // ... } three keywords: public, private, or protected determines how elements of the base class are inherited by the derived class
Making a Private Member Inheritable Private member of a base class cannot be inherited Not available to derived class directly We can change private to public that will make accessible to all other function.(There is no Data Hiding) C++ introduce third visibility modifier i.e., protected(limited purpose in inheritance). Protected accessible by the other member function within its class and immediately derived class.
Protected public mode private mode 1. accessible by derived class 1. accessible by derived class of Of member function member function 2.Ready for further inheritance 2.not available for further inheritance
Three keywords may appear in any order
Multilevel Inheritance Intermediate base class and base class for C base class for B B provide link between A And C The chain ABC is known as inheritance Path