C++ Programming Questions Answers - Set 2
-
8. We can do constructor overloading in C++ ?
- True
- False
Answer :
Option B
Explanation:
constructor overloading can be done in C++.
-
9. The private data members of a class are accessible ?
- Directly to objects of that class
- To any function defined outside a class
- Only to the member functions
- Only using keyword static
Answer :
Option C
-
10. Explicit call to a constructor means ?
- Not providing the construction name at all
- Is the shorthand method
- Providing the constructor name explicitly to invoke it
- Providing the constructor name implicitly to invoke it
Answer :
Option C
-
11. The derived class constructor
- never passes any values to base class constructor
- can pass arguments only to one base class constructor function
- is responsible for passing the entire test of arguments needed by base class constructors
- none of above
Answer :
Option C
-
12. The process of deriving a class from another derived class is known as ?
- single inheritance
- dual inheritance
- multiple inheritance
- multilevel inheritance
Answer :
Option D
-
13. The advantage of declaring a virtual function as pure is
?
- programs runs faster
- early binding can be achieved
- you force any derived class to define its own implementation
- you can avoid making the class an abstract class
Answer :
Option C
-
14. Which of following valid option will not return a value in c++ ?
- free
- void
- empty
- null
Answer :
Option B