Sure, just check one of the many links here : http://stackoverflow.com/search?q=c%23+var+keytword ;)
w69rdy
2010-08-24 16:07:33
Sure, just check one of the many links here : http://stackoverflow.com/search?q=c%23+var+keytword ;)
You can use the var keyword to infer the type of an object.
For example:
//without using the "var" keyword
Dictionary<List<string>,int> myCustomDictionary = new Dictionary<List<string>, int>();
//with the "var" keyword
var myCustomDictionary = new Dictionary<List<string>, int>();
Which is easier to read? :)