What is the use of "VAR" keyword in c#? - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Friday, March 30, 2012

What is the use of "VAR" keyword in c#?

"Var" Keyword = Var keyword is an implicit way of defining DataTypes. Implicit means indirect way of defining variable types.

In simple words by looking the data at the right hands side the left hands side data types is defined by the compiler during the generation of the "IL" code.

Let me show a simple example what does implicit (indirect) way of defining DataTypes means.

3 comments: