It works because it selects this overload:
public static String Format( IFormatProvider provider, String format, params Object[] args) { ... }
A null
provider is fine, and no arguments for varargs are suitable either, and so it just prints the string.
Intuitively, we could expect this overload:
public static String Format(String format, Object arg0) { ... }
And, of course, if he chose this, we would get an ArgumentNullException
.
source share