VAR is a 3.5 new type that defines a variable
is actually the definition of the weakening type
VAR can replace any type
The compiler will determine what type you want to use depending on the context.
As to when to use Var i think you can't be sure what type you're going to use.
You can use Var like an OBJECT
But efficiency is higher than object.
The following four characteristics are used when defining variables with Var:
1. Must be initialized at the time of definition. It must be var s = "ABCD" form, not the following form:
var s;
s = "ABCD";
2. Once initialization is complete, it is not possible to assign a value that differs from the initialization value type.
3. The var requirement is a local variable.
4. using var to define variables is different from object, which is exactly the same as defining variables in terms of efficiency and using strongly typed methods.
var keyword in C #