Note: These beginner C sharp samples codes are written keeping the beginner in mind so the code is made as simple as possible.
Starting from C# 3.0 the “var” keyword is included. var is used when you want to declare a variable’s type implicitly instead of explicit.
Explicit declaration:
string s = “Great”;
Implicit declaration:
var s = “Great”;
In compile time the datatype is determined implicitly by the compiler.
Will explain more about this in the LINQ series later.