« Use using to alias long generic type names | Main | Whidbey, Visual Basic event handlers »

C# changes from 1.1 to 2.0

As of Beta 1.

C# 1.1 à 2.0

Generic classes, interfaces, and methods. Introduces the <type,argument,list> syntax.

Generic constraints. Introduces the syntax: “where T : (class_type | “class” | “struct” ,)? (interface_type | type_parameter ,)* (“new()”)?

Anonymous methods. Re-uses “delegate” and curly braces to declare and define inline methods.

Iterators. Methods that return IEnumerator or IEnumerable (or generic variants) may use “yield return” and “yield break” syntax within a loop to yield control on each item.

Partial types. Introduces “partial” syntax.

Nullable types. Introduces “int?” syntax for all value types and “??” operator.

 

 

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)