If a member function have to be made both zero argument and parameterized constructor, which among the following can be the best option?

If a member function have to be made both zero argument and parameterized constructor, which among the following can be the best option?
A. Two normal and one default argument
B. At least one default argument
C. Exactly one default argument
D. Make all the arguments default
 
Answer: d
Explanation: All the arguments must be made default. This will make sure that none of the arguments are mandatory to be passed. Which in turn means that the function can work without any argument and can be passed with arguments too.
 

Tìm kiếm

Back
Top