When invoking a method can you even think of messing up the order of the parameters ??? YES, you can. ;) Thanks to Named Arguments in C#.
Using these you can specify parameters by a name and supply arguments in an order that differs from order of the parameters in the method signature. The following example helps you to understand this more.
// Method declaration
void NameArgs(int _first,int _second,int _thrid)
{
...
}
// Method invocation
NameArgs(_third:10,_second:5,_first:3);
Is this allow in java as well??
ReplyDelete