constructors

Ques:- A destructor name must be
A. same as class name prefixed by tilde (~) character
B. same as class name
C. same as any other member function name
D. none of the given

0 4172
Ques:- Which of the following prototype can be a copy constructor of class myclass?
A. myclass (myclass & ×)
B. myclass copy (myclass a)
C. int copy (myclass mc)
D. myclass (int myclass)

0 6451
Ques:- A copy constructor is invoked when
A. an object is passed by reference to constructor
B. a member function returns an object
C. an object is passed as a parameter to any of the member function
D. all of the above

0 9012
Ques:- Which of the following is not true?
A. Destructors cannot be overloaded
B. Constructor can have parameters
C. Constructor is executed automatically
D. Constructor cannot be Overloaded

0 1000
Ques:- Which of the following is false?
A. Constructor and member function have same name
B. Class and destructor have same name
C. Class and constructor have same name
D. Constructor and destructor have same name

0 3538
Ques:- Which of the following is automatically executed when the control reaches the end of class scope?
A. Inline function
B. Member function
C. Destructor
D. Constructor

0 5703
Ques:- Which of the following is a function that removes the allocated memory of an object?
A. Copy constructor
B. Member function
C. Destructor
D. Constructor

0 8047
Ques:- Which of the following is true?
A. The constructor function can be overloaded
B. The constructor is executed automatically
C. A constructor can have parameter list
D. All the given are true

0 2130
Ques:- Which one of the following initializes a class object and allocates memory space?
A. Member function
B. Constructor
C. Destructor
D. None of the given

0 4282
Ques:- The destructor is prefixed by the character ___
A. ~
B. %
C. #
D. &

0 5444
Ques:- Which one of the following is automatically executed when an object is created?
A. Constructor
B. Destructor
C. Inline function
D. Member function

0 2880
Ques:- 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

0 504
Ques:- When a class object goes out of scope, the function that gets executed is ____
A. Constructor
B. Destructor
C. Friend
D. Inline

0 1268
Ques:- Which is executed automatically when the control reaches the end of the class scope?
A. Constructor
B. Destructor
C. Overloading
D. Copy constructor

0 677
Ques:- The special character related to destructor is ___
A. +
B. !
C. ?
D. ~

0 7130
Ques:- The constructor without any parameter is called as ___
A. Initial constructor
B. Parameterized constructor
C. Default constructor
D. Instance parameter

0 9446
Ques:- The constructor defined by the computers in the absence of user defined constructor is ____
A. Copy
B. Abstract
C. Default
D. Destructor

0 2909
Ques:- The constructors defined by the computers in the absence of user defined constructor is called as ____
A. Non-parameterized
B. Default
C. Compiler generated
D. All of these

0 6796
Ques:- How many destructors a class can have?
A. 1
B. 2
C. 3
D. 4

0 3237
Scroll to top