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
Which of the following class allows to declare only one object of it?
Q3
Which concept allows you to reuse the written code?
Q4
Which access specifier allows members of a class to be accessed from anywhere in the program in C++?
Q5
What is the concept of data hiding in C++?
Q6
What is the correct syntax for inheriting a class in C++?
Q7
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++?
Q8
What is the default access specifier for members of a class in C++?
Q9
Which keyword is used to prevent a class from being instantiated in C++?
Q10
What is the purpose of destructors in C++?
Q11
What is the difference between an object and a class in C++?
Q12
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; }
Q13
Which operator is used to access members of a class through a pointer in C++?
Q14
What is the purpose of the 'friend' keyword in C++?
Q15
What is the purpose of using virtual functions in C++?
Q16
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
Q17
What does the term "this" pointer refer to in C++?
Q18
What is the access specifier that restricts access to members of a class to only its friend classes and member functions in C++?
Q19
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++?
Q20
How run-time polymorphisms are implemented in C++?
Q21
What is virtual inheritance?
Q22
Which type of inheritance allows a class to inherit properties and behavior from multiple base classes in C++?
Q23
What is the purpose of access specifiers in C++ classes?
Q24
How structures and classes in C++ differ?
Q25
Which keyword is used to make a class inheritable by other classes in C++?