Implicitly Typed Local Arrays
Closely related to the topic of implicitly typed local variables is the subject of implicitly typed local
arrays. Using this technique, you can allocate a new array type without specifying the type con-
tained within the array itself:
static void DeclareImplicitArrays()
{
// a is really int[].
var a = new[] { 1, 10, 100, 1000 };
Console.WriteLine("a is a: {0}", a.ToString());
Do'stlaringiz bilan baham: