What's New in C# 3.0
What's New in C# 3.0 On the heels of the Visual Studio 2005 and C# 2.0 releases, Microsoft has given a sneak preview of what to expect in the version after the next: C# 3.0. Even though C# 3.0 is not even standardized yet, Microsoft provided a preview release at its Professional Developers Conference (PDC) in September so eager developers could try out some of the expected features. This article discusses the following major new enhancements expected in C# 3.0: * Implicitly typed local variables * Anonymous types * Extension methods * Object and collection initializers * Lambda expressions * Query expressions * Expression Trees Implicitly Typed Local Variables C# 3.0 introduces a new keyword called "var". Var allows you to declare a new variable, whose type is implicitly inferred from the expression used to initialize the variable. In other words, the following is valid syntax in C# 3.0: var i = 1; The preceding line initializes the variable i to value 1 and gives it the