MCQs
Total Questions : 30
| Page 3 of 3 pages
Answer: Option B. -> =0
For making a method as pure virtual function, We have to append '=0' to the class or method.
Answer: Option A. -> Function which does not have definition of its own.
As the name itself implies, it have to depend on other class only.
Answer: Option A. -> We cannot make an instance of an abstract base class
We cannot make an instance of an abstract base class
Answer: Option B. -> pure virtual function
Classes that contain at least one pure virtual function are called as abstract base classes.
Answer: Option A. -> base class only
base class only
Answer: Option B. -> base
Because derived inherits functions and variables from base.
Answer: Option B. -> ~
~
Answer: Option C. -> both a & b
both a & b
Answer: Option B. -> base class
Because it is having the proper data set to initialize, Otherwise it will throw a error.
Answer: Option B. -> A derived class's destructor cannot invoke its base class's destructor.
Destructors are automatically invoked when a object goes out of scope or when a dynamically allocated object is deleted. Inheritance does not change this behavior. This is the reason a derived destructor cannot invoke its base class destructor.