C# Implicitly Typed Local VariableIn 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 ExampleOutput: 20 javatpoint 3 Next TopicC# Object and Collection Initializer |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India