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?
A -
Compile-time error.
B -
Preprocessing error.
C -
Runtime error.
D -
Runtime exception.
2-
Destructor has the same name as the constructor and it is preceded by ______ .
A -
!
B -
?
C -
~
D -
$
3-
For automatic objects, constructors and destructors are called each time the objects
A -
enter and leave scope
B -
inherit parent class
C -
are constructed
D -
are destroyed
4-
Which constructor function is designed to copy objects of the same class type?
A -
Create constructor
B -
Object constructor
C -
Dynamic constructor
D -
Copy constructor
5-
Which of the following statement is correct?
A -
Constructor has the same name as that of the class.
B -
Destructor has the same name as that of the class with a tilde symbol at the beginning.
C -
Both A and B.
D -
Destructor has the same name as the first member function of the class.
6-
Which of the following statement is incorrect?
A -
Constructor is a member function of the class.
B -
The compiler always provides a zero argument constructor.
C -
It is necessary that a constructor in a class should always be public.
D -
Both B and C.
7-
When are the Global objects destroyed?
A -
When the control comes out of the block in which they are being used.
B -
When the program terminates.
C -
When the control comes out of the function in which they are being used.
D -
As soon as local objects die.
8-
Copy constructor must receive its arguments by __________ .
A -
either pass-by-value or pass-by-reference
B -
only pass-by-value
C -
only pass-by-reference
D -
only pass by address
9-
A function with the same name as the class, but preceded with a tilde character (~) is called __________ of that class.
A -
constructor
B -
destructor
C -
function
D -
object
10-
A union that has no constructor can be initialized with another union of __________ type.