1.

If a function have all the default arguments but still some values are passed to the function then ______________(a) The function will use the values passed to it(b) The function will use the default values as those are local(c) The function can use any value whichever is higher(d) The function will choose the minimum valuesI had been asked this question in an internship interview.This intriguing question originated from Default Arguments topic in division Default Arguments vs Overloading, Upcasting and Downcasting of Object Oriented Programming

Answer»

Correct choice is (a) The FUNCTION will use the values PASSED to it

Easiest EXPLANATION - The function will use the values passed EXPLICITLY to it. The default values will be ignored. The default values are used only in CASE the values are not passed explicitly to the function.



Discussion

No Comment Found

Related InterviewSolutions