C++ programming language
31. The break statement causes an exit
- from the innermost loop only.
- only from the innermost switch.
- from all loops & switches.
- from the innermost loop or switch.
Correct answer: (D)
from the innermost loop or switch.
32. The keyword friend does not appear in
- the class allowing access to another class.
- the class desiring access to another class.
- the private section of a class.
- the public section of a class.
Correct answer: (C)
the private section of a class.
33. The members of a class, by default, are
- public
- protected
- private
- mandatory to specify
Correct answer: (C)
private
34. The operator << when overloaded in a class
- must be a member function
- must be a non member function
- can be both (A) & (B) above
- cannot be overloaded
Correct answer: (C)
can be both (A) & (B) above
35. The operator that cannot be overloaded is
- ++
- ::
- ( )
- ∼
36. The process of building new classes from existing one is called
- Structure.
- Inheritance.
- Polymorphism.
- Template.
Correct answer: (B)
Inheritance.
37. The process of building new classes from existing one is called _________.
- Polymorphism
- Structure
- Inheritance
- Cascading
Correct answer: (C)
Inheritance
38. this pointer
- implicitly points to an object.
- can be explicitly used in a class.
- can be used to return an object.
- All of the above.
Correct answer: (D)
All of the above.
39. To perform stream I/O with disk files in C++, you should
- open and close files as in procedural languages.
- use classes derived from ios.
- use C language library functions to read and write data.
- include the IOSTREAM.H header file.
Correct answer: (B)
use classes derived from ios.
40. Use of virtual functions implies
- overloading.
- overriding.
- static binding.
- dynamic binding.
Correct answer: (D)
dynamic binding.