Tuesday, May 18, 2010

New features of c# framework 4.0

New features of c# framework 4.0


1]Dynamic:Now you can create dynamic objects and let their types be determined at run time.

2]Covariance and Contravariance:Variance on generic type parameters in interfaces and delegates is another important feature of this release. It doesn’t add much new functionality, but rather makes things work as you expected them to in the first place. The major advantage is hidden in this simple line, which didn’t compile until C# 4.0

3]Optional (or Default) Parameters:Now you can assign a default value to a parameter right within the method declaration. The user of the method can either pass a value or simply skip the argument. In the latter case, the default value is passed to the method.

4]Named Arguments:The order of parameters in a method declaration and the order of arguments you pass when calling the method don’t need to match anymore. You can provide arguments in any order you like by specifying parameter names in a method call. This might also improve the readability of your code.

5]Improved COM Interop:The introduction of the dynamic keyword, optional parameters and named arguments enables improvement of COM interop.

Here are some links for further reading:
regards,

"Please give me your valuable comments to improve my knowledge :) " 

    No comments:

    Post a Comment