Search
Thursday, March 27, 2008
C# 3.0 : 5 new features
5 new features for C# 3.0:
- lambda expression ( [input parameter] => [expression or statement] )
- Var keyword ( used for unknown type, collection, or object)
var object = new {name="john", age=22);
[anonymous type]
- extension method
add more method using static class -->example: public static string threeFirstLetters ( this string x)
this will create another method in string class. cool~
- partial method
declaration and implementation can be in different file
- query expression
ex : helloword.Where(word => (word[0] >'g').Select(word => word+' ');
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment