OOPS Constructors MCQ Quiz Questions and Answers - 2

Question: 6

When an instance of a class comes into scope, the function that executed is ____

(A) Destructor

(B) Constructor

(C) Inline

(D) Friend

Ans: B

Constructor

Question: 7

The destructor is prefixed by the character ___

(A) ~

(B) %

(C) #

(D) &

Ans: A

~

Question: 8

Which one of the following is automatically executed when an object is created?

(A) Constructor

(B) Destructor

(C) Inline function

(D) Member function

Ans: A

Constructor

Question: 9

The name of constructor must be ___

(A) Same as object name

(B) Same as one of the member function

(C) Same as class name

(D) None of the given

Ans: C

Same as class name

Question: 10

When an object is passed by reference to constructor, the constructor that is executed is _____

(A) Inline

(B) Default

(C) Static

(D) Copy

Ans: D

Copy

Related Questions