Q.1

A union that has no constructor can be initialized with another union of __________ type.

  • different
  • same
  • virtual
  • class
Q.2

Which of the following gets called when an object goes out of scope?

  • constructor
  • destructor
  • main
  • virtual function
Q.3

Constructors __________ to allow different approaches of object construction.

  • cannot overloaded
  • can be overloaded
  • can be called
  • can be nested
Q.4

Which of the following cannot be declared as virtual?

  • Constructor
  • Destructor
  • Data Members
  • Both A and C
Q.5

What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor?

  • Compile-time error.
  • Preprocessing error.
  • Runtime error.
  • Runtime exception.
Q.6

Which of the following statement is incorrect?

  • Constructor is a member function of the class.
  • The compiler always provides a zero argument constructor.
  • It is necessary that a constructor in a class should always be public.
  • Both B and C.
Q.7

When are the Global objects destroyed?

  • When the control comes out of the block in which they are being used.
  • When the program terminates.
  • When the control comes out of the function in which they are being used.
  • As soon as local objects die.
Q.8

Which of the following statement is correct whenever an object goes out of scope?

  • The default constructor of the object is called.
  • The parameterized destructor is called.
  • The default destructor of the object is called.
  • None of the above.
Q.9

Which of the following never requires any arguments?

  • Member function
  • Friend function
  • Default constructor
  • const function
Q.10

Which of the following statements are correct?

  • Constructor is always called explicitly.
  • Constructor is called either implicitly or explicitly, whereas destructor is always called implicitly.
  • Destructor is always called explicitly.
  • Constructor and destructor functions are not called at all as they are always inline.
Q.11

How many times a constructor is called in the life-time of an object?

  • Only once
  • Twice
  • Thrice
  • Depends on the way of creation of object
Q.12

Which of the following statement is correct about destructors?

  • A destructor has void return type.
  • A destructor has integer return type.
  • A destructor has no return type.
  • A destructors return type is always same as that of main().
Q.13

__________ used to make a copy of one class object from another class object of the same class type.

  • constructor
  • copy constructor
  • destructor
  • default constructor
Q.14

If the copy constructor receives its arguments by value, the copy constructor would

  • call one-argument constructor of the class
  • work without any problem
  • call itself recursively
  • call zero-argument constructor
Q.15

Can a class have virtual destructor?

  • Yes
  • No
Q.16

Destructor has the same name as the constructor and it is preceded by ______ .

  • !
  • ?
  • ~
  • $
Q.17

Copy constructor must receive its arguments by __________ .

  • either pass-by-value or pass-by-reference
  • only pass-by-value
  • only pass-by-reference
  • only pass by address
Q.18

Which of the following are NOT provided by the compiler by default?

  • Zero-argument Constructor
  • Destructor
  • Copy Constructor
  • Copy Destructor
Q.19

For automatic objects, constructors and destructors are called each time the objects

  • enter and leave scope
  • inherit parent class
  • are constructed
  • are destroyed
0 h : 0 m : 1 s