Sail E0 Webinar

MCQs

Total Questions : 39 | Page 3 of 4 pages
Question 21.

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


  1.    call one-argument constructor of the class
  2.    work without any problem
  3.    call itself recursively
  4.    call zero-argument constructor
 Discuss Question
Answer: Option C. -> call itself recursively


Question 22.

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


  1.    constructor
  2.    copy constructor
  3.    destructor
  4.    default constructor
 Discuss Question
Answer: Option B. -> copy constructor


Question 23.

Constructors __________ to allow different approaches of object construction.


  1.    cannot overloaded
  2.    can be overloaded
  3.    can be called
  4.    can be nested
 Discuss Question
Answer: Option B. -> can be overloaded


Question 24.

Which of the following cannot be declared as virtual?


  1.    Constructor
  2.    Destructor
  3.    Data Members
  4.    Both A and C
 Discuss Question
Answer: Option D. -> Both A and C


Question 25.

Which of the following statement is correct?


  1.    A destructor has the same name as the class in which it is present.
  2.    A destructor has a different name than the class in which it is present.
  3.    A destructor always returns an integer.
  4.    A destructor can be overloaded.
 Discuss Question
Answer: Option A. -> A destructor has the same name as the class in which it is present.


Question 26.

Which of the following statement is correct?


  1.    Destructor destroys only integer data members of the object.
  2.    Destructor destroys only float data members of the object.
  3.    Destructor destroys only pointer data members of the object.
  4.    Destructor destroys the complete object.
 Discuss Question
Answer: Option D. -> Destructor destroys the complete object.


Question 27.

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


  1.    constructor
  2.    destructor
  3.    main
  4.    virtual function
 Discuss Question
Answer: Option B. -> destructor


Question 28.

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


  1.    different
  2.    same
  3.    virtual
  4.    class
 Discuss Question
Answer: Option B. -> same


Question 29.

Copy constructor must receive its arguments by __________ .


  1.    either pass-by-value or pass-by-reference
  2.    only pass-by-value
  3.    only pass-by-reference
  4.    only pass by address
 Discuss Question
Answer: Option C. -> only pass-by-reference


Question 30.

A function with the same name as the class, but preceded with a tilde character (~) is called __________ 

of that class.


  1.    constructor
  2.    destructor
  3.    function
  4.    object
 Discuss Question
Answer: Option B. -> destructor


Latest Videos

Latest Test Papers