C#4.0 New Features List

Your Ad Here

Dynamic types: is a feature which gives you a ability to skip static type checking (compile time type checking) and resolves the type at run time for the following functions.
1: Method
2: Operator
3: Indexers
4: Property
5: Field Access
6: Object Invocation

Named and optional parameters: Till now C# had no option of having optional parameters but now in C#4.0 , we can pass the optional parameters by giving them some default values like

public long addNumbers(int number1 , int number2 , long pi = 3.14){
return number1+ number2+ pi ;}

There is new option of passing the parameters by Name like
Call the above given functions as

long result = addNumbers(number2=4 , number1= 5);

Variance : In C# 3.0 , it was used to be IEnumerable and it was not allowed to be used as IEnumerable. But now in C#4.0 , co and contra-variance can be used .

In Next post, i am going to discuss the dynamic type in detail.

Till than Happpy Coding.

Subscribe
Posted in Labels: kick it on DotNetKicks.com |

1 comments:

  1. Anonymous Says:

    http://aspnetcsharp4.blogspot.com/2009/05/first-look-vs2010.html
    http://aspnetcsharp4.blogspot.com/2009/05/c40-new-features-list.html
    http://aspnetcsharp4.blogspot.com/2009/05/variance-in-c-40.html
    http://aspnetcsharp4.blogspot.com/2009/05/whats-new-in-aspnet-40.html
    http://aspnetcsharp4.blogspot.com/2009/05/aspnet-40-core-services.html
    http://aspnetcsharp4.blogspot.com/2009/05/auto-start-web-applications.html
    http://aspnetcsharp4.blogspot.com/2009/05/ajax-and-new-template-engine-in.html
    http://aspnetcsharp4.blogspot.com/2009/05/shrinking-session-state.html
    http://aspnetcsharp4.blogspot.com/2009/05/routing-of-urls-capability-is-added.html

    http://aspnetcsharp4.blogspot.com/2009/06/access-twitter-api-using-c.html
    http://aspnetcsharp4.blogspot.com/2009/06/free-aspnet40-hosting-available.html
    http://aspnetcsharp4.blogspot.com/2009/06/lazy-evaluation-feature-in-c.html
    http://aspnetcsharp4.blogspot.com/2009/06/difference-between-shadowing-and.html

    http://aspnetcsharp4.blogspot.com/2009/07/microsoft-aspnet-40-data-access.html
    http://aspnetcsharp4.blogspot.com/2009/07/microsoft-aspnet-40-whats-next.html
    http://aspnetcsharp4.blogspot.com/2009/07/ajax-client-side-templating-in-aspnet.html
    http://aspnetcsharp4.blogspot.com/2009/07/jquery-in-aspnet.html
    http://aspnetcsharp4.blogspot.com/2009/07/c-interview-questions.html
    http://aspnetcsharp4.blogspot.com/2009/07/using-ajax-control-toolbox-with-jquery.html
    http://aspnetcsharp4.blogspot.com/2009/07/microsoft-interview-questions.html
    http://aspnetcsharp4.blogspot.com/2009/07/json-and-aspnet.html
    http://aspnetcsharp4.blogspot.com/2009/07/aspnet-questions-with-detailed-answers.html