OOPS
August 29, 2024OOPS
August 29, 2024OOPS
|
Question 16
|
How constructor differ from destructor?
|
Constructors can be overloaded but destructors can’t be overloaded
|
|
|
Constructors can take arguments but destructor can’t
|
|
|
Constructors can be overloaded but destructors can’t be overloaded and Constructors can take arguments but destructor can’t
|
|
|
None of the given options
|
Question 16 Explanation:
Constructors can be overloaded but destructors can’t be overloaded.
Destructors cant be overloaded because your code wouldn’t have a clue about which destructor it needs to call when you destroy an object.
Destructors cant be overloaded because your code wouldn’t have a clue about which destructor it needs to call when you destroy an object.
Correct Answer: C
Question 16 Explanation:
Constructors can be overloaded but destructors can’t be overloaded.
Destructors cant be overloaded because your code wouldn’t have a clue about which destructor it needs to call when you destroy an object.
Destructors cant be overloaded because your code wouldn’t have a clue about which destructor it needs to call when you destroy an object.
