0

Overloading with default parameters

if 2 methods of the same name have parameters with default values defined, how is overloading resolved?

22nd Dec 2016, 11:38 AM
ifl
ifl - avatar
1 Réponse
+ 1
parameters type must be difference. Example: You have 2 methods 1-A(int a) and 2-A(float A). If you call A(1), the first method was called, otherwise A(1.0), second method fire. If you call function with no parameters, exception raise ...
22nd Dec 2016, 4:42 PM
Quốc Hùng