C# Implicitly Typed Local Variable
In C#, we can create local variable without specifying its type. The C# var keyword is used to create implicit typed local variables. The C# compiler infers the types of variable on the basis of assigned value.
The var keyword can be used in following context.
The var keyword has following restrictions.
Let's see an example. Here, we have created integer, string and array type local variables.
C# Implicit Typed Local Variable Example
20 javatpoint 3