«« Next » « Previous
«« Next » « Previous

Link Details

Vote up, vote down. It doesn't matter which - just vote! Login and vote now.
Link 80828 thumbnail

By bloid
via nick.gravelyn.com
Submitted: May 13 2008 / 18:01

This will be my last post tonight and coincidentally the last feature of C# 3.0 that will work for all platforms. This compiler trick is the new “implicitly typed local variable”. What does that mean? It means that, for local variables, you no longer have to type the variable type if you also instantiate or initialize it on that same line. The compiler will infer the type from the rest of the line and fill in the type for you. This new feature is done through the ‘var’ keyword. So for instance where you used to write something like this:
  • 1
  • 0
  • 82
  • 10

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (1)



Voters Against This Link (0)