Question 1 of 25
Hints left: 3
Q1
What is the default access specifier for a base class when inheriting in C++?
Q2
In C++, which access specifier allows the members of a base class to be accessible in the derived class, its derived classes, but not from outside the class hierarchy?
Q3
What is the diamond problem in C++ inheritance?
Q4
In C++, what happens if a derived class redefines a method that is already defined in its base class?
Q5
In C++, what happens if a derived class inherits from multiple base classes and each base class has a member with the same name?
Q6
In C++, which access specifier allows the members of a base class to be accessible in the derived class and its derived classes, but not from outside the class hierarchy?
Q7
In C++, which type of inheritance involves a class inheriting from multiple classes directly or indirectly?
Q8
What is the name given to the process of creating a new class by inheriting properties and behaviors from an existing class in C++?
Q9
In C++, what happens if a derived class inherits multiple base classes and each base class contains a member with the same name?
Q10
In C++, what is the process of creating a new class from an existing class known as?
Q11
What is the process called when a new class is created by inheriting properties and behaviors from an existing class in C++?
Q12
In C++, which keyword is used to denote the access specifier in a derived class when inheriting from a base class?
Q13
Which specifier makes all the data members and functions of base class inaccessible by the derived class?
Q14
What will be the output of the following C++ code? #include <iostream> #include <string> using namespace std; class Mammal { public: Mammal(){ cout<<"I'm a Mammal\n"; } ~Mammal(){} }; class Human: public Mammal { public: Human(){ cout<<"I'm a Human\n"; } ~Human(){} }; class Male: public Human { public: Male(){ cout<<"I'm a Male\n"; } ~Male(){} }; class Female: public Human { public: Female(){ cout<<"I'm a Female\n"; } ~Female(){} }; int main(int argc, char const *argv[]) { Male M; return 0; }
Q15
Which type of inheritance involves a class inheriting from multiple classes directly or indirectly in C++?
Q16
In C++, what is the process of creating a new class using an existing class as a blueprint and adding new functionalities to it?
Q17
In C++, which type of inheritance involves inheriting from multiple base classes, but only inheriting one level deep from each base class?
Q18
Which keyword is used to prevent a class from being inherited in C++?
Q19
In C++, which access specifier allows the members of a base class to be accessible in the derived class, but not from outside the class?
Q20
Which keyword is used to denote the access specifier in a derived class when inheriting from a base class in C++?
Q21
In C++, what is the default access specifier for a base class when inheriting?
Q22
What is the term used to describe a class that inherits properties and behaviors from another class in C++?
Q23
In C++, what is the process called when a class inherits properties and behaviors from multiple base classes?
Q24
What happens if a derived class inherits multiple base classes and each base class contains a member with the same name in C++?
Q25
What is the term used to describe a class that inherits from another class in C++?