Tutor HuntResources C Sharp Resources

New Features In C# 6.0

C# language and .NET are very popular with developers all over the world for programming C# applications which are used in daily life. . C# programming books are very popular with the experienced as they offer important information regarding the development of C# applications.

Date : 24/11/2016

Author Information

Ramesh

Uploaded by : Ramesh
Uploaded on : 24/11/2016
Subject : C Sharp

1. using Static

This is a new concept in C# 6.0 that allows us to use any class that is static as a namespace that is very usefull for every developer in that code file where we need to call the static methods from a static class like in a number of times we need to call many methods from Convert.ToInt32() or Console.Write(),Console.WriteLine() so we need to write the class name first then the method name every time in C# 5.0. In C# 6.0 however Microsoft announced a new behavior to our cs compiler that allows me to call all the static methods from the static class without the name of the classes because now we need to first use our static class name in starting with all the namespaces.

2. Auto property initializer

Auto property initializer is a new concept to set the value of a property during of property declaration. We can set the default value of a read=only property, it means a property that only has a {get} attribute. In the previous version of C# 5.0 we can set the values of the property in the default constructor of the class. Let`s have an example. Suppose we need to set some property`s value of a class as in the following:

3. Dictionary Initializer

Dictionary initializer is a new concept in C# 6.0. We can directly initialize a value of a key in a Dictionary Collection with it, either the key in the collection would be a string data type or any other data type. Let`s see the declaration syntax in both versions like in C# 5.0 and also in C# 6.0 respectively.

This resource was uploaded by: Ramesh

Other articles by this author