C++ programming language

31. The break statement causes an exit

  1. from the innermost loop only.
  2. only from the innermost switch.
  3. from all loops & switches.
  4. from the innermost loop or switch.

Correct answer: (D)
from the innermost loop or switch.

32. The keyword friend does not appear in

  1. the class allowing access to another class.
  2. the class desiring access to another class.
  3. the private section of a class.
  4. the public section of a class.

Correct answer: (C)
the private section of a class.

33. The members of a class, by default, are

  1. public
  2. protected
  3. private
  4. mandatory to specify

Correct answer: (C)
private

34. The operator << when overloaded in a class

  1. must be a member function
  2. must be a non member function
  3. can be both (A) & (B) above
  4. cannot be overloaded

Correct answer: (C)
can be both (A) & (B) above

35. The operator that cannot be overloaded is

  1. ++
  2. ::
  3. ( )

Correct answer: (D)

36. The process of building new classes from existing one is called

  1. Structure.
  2. Inheritance.
  3. Polymorphism.
  4. Template.

Correct answer: (B)
Inheritance.

37. The process of building new classes from existing one is called _________.

  1. Polymorphism
  2. Structure
  3. Inheritance
  4. Cascading

Correct answer: (C)
Inheritance

38. this pointer

  1. implicitly points to an object.
  2. can be explicitly used in a class.
  3. can be used to return an object.
  4. All of the above.

Correct answer: (D)
All of the above.

39. To perform stream I/O with disk files in C++, you should

  1. open and close files as in procedural languages.
  2. use classes derived from ios.
  3. use C language library functions to read and write data.
  4. include the IOSTREAM.H header file.

Correct answer: (B)
use classes derived from ios.

40. Use of virtual functions implies

  1. overloading.
  2. overriding.
  3. static binding.
  4. dynamic binding.

Correct answer: (D)
dynamic binding.

Page 4 of 5