Object-Oriented Programming C++inheritance types of inheritanceexampple program .pptx

kavirajee 14 views 11 slides May 01, 2024
Slide 1
Slide 1 of 11
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11

About This Presentation

Object-Oriented Programming C++inheritance types of inheritanceexampple program


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
Tags