0
What is var
3 Answers
+ 1
var is short for variable. C# can automatically infer the data type for you when you use var. Therefore, you can type:
int numberTwo = 2 or var numberTwo = 2. The C# compiler can infer that var numberTwo = 2 is of type int.
0
It's variable that you can create. Variable is basically container for storing informations.
0
var is dynamic datatype it will hold any type of variable. for ex. var number=1;
or var number="one";