>var I think maybe short for variant. Not sure, but putting var before cutomer will ensure that any type returned will
>fit into the "customer" variable.
Not really. From :http://msdn.microsoft.com/en-us/library/bb384061.aspx :
"The var keyword instructs the compiler to infer the type of the variable from the expression on the right side of the initialization statement. "
and
"It is important to understand that the var keyword does not mean “variant” and does not indicate that the variable is loosely typed, or late-bound. It just means that the compiler determines and assigns the most appropriate type"
Only two reasone to use var really :
(a) with anonymous types (where you have no option)
or
(b) laziness :-}
>
>Such as:
>
>var varOne = new List<int>(); // will be of type IList
>
>var varTwo = new ENumerable<int>(); // will be of type IEnumberable
>
>You can also say:
>
>IEnumerable<int> someEnumType = new List<int>();
>
>But you can't say the reverse:
>
>IList<int> someListType = new Enumerable<int>();
>
>So var ensures that it will convert to the correct type.
>
>
>>What's the benefit of
>>var customer = new Customer();