Object Oriented Programming
Object Oriented Programming
SAADIA BANO
Lecturer
[email protected]
COMSATS Institute of Information Technology
Department of Computer Science,
Sahiwal
Function overriding
Public inheritance
Syntax: class child:public parent
Private inheritance
Syntax: class child: private parent
Protected inheritance
Syntax: class child:protected parent
How to access protected member of
parent class
Container-ship
Example:
Class A
{
};
Class B
{
A obj;
};
Example