State and describe visibility modes and its effects used in inheritance.
Different visibility modes are:
1. Private
2. Protected
3. Public
Effects of visibility modes in inheritance:
Private members of base class are not inherited directly in any
visibility mode.
1. Private visibility mode
In this mode, protected and public members of base class become private members of derived class.
2. Protected visibility mode
In this mode, protected and public members of base class become protected members of derived class.
3. Public visibility mode
In this mode, protected members of base class become protected members of derived class and public members of base class become public members of derived class.