In fact, you cannot just specify:
Console.WriteLine(foo + " " + bar);
or
System.out.println(foo + " " + bar);
I mean, you can write a method with an array / varargs parameter, for example. (FROM#)
public void WriteToConsole(params object[] values) { string separator = ""; foreach (object value in values) { Console.Write(separator); separator = " "; Console.Write(value); } }
... but personally, I would not do that.
Jon skeet
source share