Exercise: Constructors And Destructors

Questions for: Constructors And Destructors

Destructors __________ for automatic objects if the program terminates with a call to function exit or function abort.
A:
are called
B:
are inherited
C:
are not called
D:
are created
Answer: C
No answer description is available. Let's discuss.
A class's __________ is called when an object is destroyed.
A:
constructor
B:
destructor
C:
assignment function
D:
copy constructor
Answer: B
No answer description is available. Let's discuss.
Which of the following never requires any arguments?
A:
Member function
B:
Friend function
C:
Default constructor
D:
const function
Answer: C
No answer description is available. Let's discuss.
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: A
No answer description is available. Let's discuss.
A destructor takes __________ arguments.
A:
one
B:
two
C:
three
D:
no
Answer: D
No answer description is available. Let's discuss.
Ad Slot (Above Pagination)
Quiz