Question 1 of 25
Hints left: 3
Q1
Which keyword is used to access the superclass constructor in a derived class constructor in C++?
Q2
What is the term for the ability of a class to provide different implementations of a function depending on the types of its parameters in C++?
Q3
Which type of inheritance allows a class to inherit properties and behavior from multiple base classes in C++?
Q4
What is virtual inheritance?
Q5
What is the difference between an object and a class in C++?
Q6
Which of the following is correct about new and malloc? i. new is an operator whereas malloc is a function ii. new calls constructor malloc does not iii. new returns required pointer whereas malloc returns void pointer and needs to be typecast
Q7
What is the default access specifier for members of a class in C++?
Q8
What will be the output of the following C++ code? #include<iostream> using namespace std; class Base { public: Base() { cout<<"Constructing Base \n"; } virtual~Base() { cout<<"Destructing Base \n"; } }; class Derived: public Base { public: Derived() { cout<<"Constructing Derived \n"; } ~Derived() { cout<<"Destructing Derived \n"; } }; int main(void) { Derived *d = new Derived(); Base *b = d; delete b; return 0; }
Q9
What is the process of hiding the implementation details of a class and showing only the necessary features to the outside world called in C++?
Q10
What is the access specifier that restricts access to members of a class to only its friend classes and member functions in C++?
Q11
What is the purpose of using virtual functions in C++?
Q12
How structures and classes in C++ differ?
Q13
What is the purpose of destructors in C++?
Q14
Which concept allows you to reuse the written code?
Q15
Which access specifier allows members of a class to be accessed from anywhere in the program in C++?
Q16
What is the concept of data hiding in C++?
Q17
What is the purpose of the 'friend' keyword in C++?
Q18
Which keyword is used to make a class inheritable by other classes in C++?
Q19
Which of the following class allows to declare only one object of it?
Q20
What is the correct syntax for inheriting a class in C++?
Q21
What is the purpose of access specifiers in C++ classes?
Q22
Which keyword is used to prevent a class from being instantiated in C++?
Q23
What does the term "this" pointer refer to in C++?
Q24
How run-time polymorphisms are implemented in C++?
Q25
Which operator is used to access members of a class through a pointer in C++?