-
Categories CloudThis will be shown to users with no Flash or Javascript.
-
Directory Statistics
- Active Links: 84573
- Todays Links: 32
- Active Articles: 2544
- Todays Articles: 0
Free Directory SubmitArticle Details
Industrial/Summer training institute in kanpur |
|
| Date Added: August 26, 2011 11:36:24 AM | |
| Author: Avinash Kaur | |
| Category: Computers and Internet: Training | |
C Sharp 4.0 New Features •Dynamic Typing•Optional and Named Parameters•Improved COM-Interop•Contra and Co-VarianceDynamic Typing The Microsoft has released a new dynamic typing capability in C Sharp. It is now always possible to know statically what objects might end up being. Instead of using the object keyword and making everything of this type, we can now let the DLR out at runtime. You are able to Interop with various dynamic languages and work with DOM more easily. It is even simple to work with the Microsoft Office COM APIs now. The DLR has been built upon the Common Language Runtime to provide the ability to together all the dynamic language interactions. The new "dynamic" keyword use to access the new DLR, this flag to the compiler; when this keyword is encountered, the compiler will realize that it is a dynamic invocation and not the typical static invocation. Optional and Named Parameters Optional parameters allow you to provide default values for some of the parameters of your methods and allow for a type of overloading by the consumer, even if there is only a single method in place to deal with all the variants. Class UserSettings { public void NewUser(string firstName, string lastName, bool isAdmin, bool isUser) { } } If you want to overload this and have default values for the two bool objects, then you could easily have a few more methods that populate these values for the consumer and then make a call to the master method to actually create the New User. Optional parameters public void NewUser(string firstName, string lastName, bool isAdmin=false, bool isUser=true) { } The parameters firstName and lastName do not have a default value. But the another parameters do have default value. myuser.NewUser("C Sharp", "Tutorial"); myuser.NewUser("C Sharp", "Tutorial", true); myuser.NewUser("C Sharp", "Tutorial", true, false); myuser.NewUser("C Sharp", "Tutorial", isUser: false); Contra and Co-Variance The prior version of .NET, you were able to use contra-variance with objects and arrays, but for instance, you were unable to use contra-variance with generic interface. In. NET 4.0 to extend to perform even better when working with generics and delegates. |
|
|
|
|
-
Featured Website
-
Twitter Ticker

My tweets

-
Latest Links
-
Latest ArticlesIndustrial Ventilation Systems
VOCs, or volatile organic compounds are emitted by a wide array of products and processes.
Meneghetti Award 2013
Néo presents an initiative promoted by the Antonio Meneghetti Scientific and Humanistic Research Foundation.


