I was looking through the documentation and noticed that the Console.WriteLine() method had several overloads. In particular, my curiosity and partial confusion relate to them:
public static void WriteLine(string format, params object[] arg); public static void WriteLine(string format, object arg0); public static void WriteLine(string format, object arg0, object arg1); public static void WriteLine(string format, object arg0, object arg1, object arg2); public static void WriteLine(string format, object arg0, object arg1, object arg2, object arg3);
Seems redundant. What do the other four overloads need above the first? The first method is capable of doing everything that other methods can do. Is there a performance issue that they tried to solve by providing extra overloads that handle up to four arguments (the latter)? Is overhead an affordable array of up to four arguments sufficient to handle these overloads?
c #
BK Mar 07 '14 at 5:44 2014-03-07 05:44
source share