OOP Quest - Answers
OOP Quest - Answers
2. What is OOP?
Object-Oriented Programming (OOP) is a programming paradigm based on
the concept of objects that contain both data and functions.
8. What is constructor?
A constructor in C++ is a special method that is automatically called
when an object of a class is created.
In single inheritance, a class is allowed to inherit from only one class. i.e.
one child class inherits one base class only.
2. Multiple inheritance
3. Multilevel inheritance
In this type of inheritance, more than one subclass is inherited from a single
base class. i.e. more than one derived class is created from a single base
class.
5. Hybrid inheritance
Public inheritance: makes public members of the base class public in the
derived class, and the Protected members of the base class Protected in the
derived class.
Protected Inheritance: makes the Public and Protected members of the base
class Protected in the derived class.
Private Inheritance: makes the Public and Protected members of the base
class Private in the derived class.