Sail E0 Webinar

MCQs

Total Questions : 39 | Page 2 of 4 pages
Question 11.

Destructor calls are made in which order of the corresponding constructor calls?


  1.    Reverse order
  2.    Forward order
  3.    Depends on how the object is constructed
  4.    Depends on how many objects are constructed
 Discuss Question
Answer: Option A. -> Reverse order


Question 12.

Which of the following statement is correct?


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


Question 13.

Which of the following implicitly creates a default constructor when the programmer does not explicitly 

define at least one constructor for a class?


  1.    Preprocessor
  2.    Linker
  3.    Loader
  4.    Compiler
 Discuss Question
Answer: Option D. -> Compiler


Question 14.

Which of the following statement is correct about destructors?


  1.    A destructor has void return type.
  2.    A destructor has integer return type.
  3.    A destructor has no return type.
  4.    A destructors return type is always same as that of main().
 Discuss Question
Answer: Option C. -> A destructor has no return type.


Question 15.

A destructor takes __________ arguments.


  1.    one
  2.    two
  3.    three
  4.    no
 Discuss Question
Answer: Option D. -> no


Question 16.

How many default constructors per class are possible?


  1.    Only one
  2.    Two
  3.    Three
  4.    Unlimited
 Discuss Question
Answer: Option A. -> Only one


Question 17.

If the programmer does not explicitly provide a destructor, then which of the following creates

an empty destructor?


  1.    Preprocessor
  2.    Compiler
  3.    Linker
  4.    main() function
 Discuss Question
Answer: Option B. -> Compiler


Question 18.

A __________ is a constructor that either has no parameters, or if it has parameters, all the 

parameters have default values.


  1.    default constructor
  2.    copy constructor
  3.    Both A and B
  4.    None of these
 Discuss Question
Answer: Option A. -> default constructor


Question 19.

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


  1.    Zero-argument Constructor
  2.    Destructor
  3.    Copy Constructor
  4.    Copy Destructor
 Discuss Question
Answer: Option D. -> Copy Destructor


Question 20.

It is a __________ error to pass arguments to a destructor.


  1.    logical
  2.    virtual
  3.    syntax
  4.    linker
 Discuss Question
Answer: Option C. -> syntax


Latest Videos

Latest Test Papers