Programming - C++ Language
You Are Here :: Home > C++ Language > constructor - General Questions
37.
Which of the following statement is correct about destructors?
A.
A destructor has void return type.
B.
A destructor has integer return type.
C.
A destructor has no return type.
D.
A destructors return type is always same as that of main().
Answer: Option C
Explanation:
38.
Which of the following implicitly creates a default constructor when the programmer does not explicitly define at least one constructor for a class?
A.
Preprocessor
B.
Linker
C.
Loader
D.
Compiler
Answer: Option D
Explanation:
39.
Destructor calls are made in which order of the corresponding constructor calls?
A.
Reverse order
B.
Forward order
C.
Depends on how the object is constructed
D.
Depends on how many objects are constructed
Answer: Option A
Explanation:
40.
A constructor that accepts __________ parameters is called the default constructor.
A.
one
B.
two
C.
no
D.
three
Answer: Option C
Explanation:
41.
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.
Answer: Option A
Explanation:
42.
Which of the following never requires any arguments?
A.
Member function
B.
Friend function
C.
Default constructor
D.
const function
Answer: Option C
Explanation:
« prev
next »