InterviewSolution
Saved Bookmarks
| 1. |
If there is a constructor with all the default arguments and arguments are not passed then _________________(a) The default values given will not be used(b) Then all the null values will be used(c) Then all the default values given will be used(d) Then compiler will produce an errorThis question was posed to me in homework.I need to ask this question from Constructors Overloading topic in section Default Arguments vs Overloading, Upcasting and Downcasting of Object Oriented Programming |
|
Answer» RIGHT answer is (C) Then all the default values GIVEN will be used Best explanation: The CONSTRUCTORS will use the default values listed for use. The null values are not used because those are not specified. Though if it was compiler PROVIDED default constructor, then it would have initialized the members to null or zero values. |
|