C# 6.0–Static class using statement

  • Home
  • Blog
  • C# 6.0–Static class using statement

This blog post is part of C# 6.0 Features Series.

C# 6.0 version introduced lot of small features and one of that features is  using feature. Now with C# 6.0 you can use using statement which was not possible in earlier versions of  C#. Following is a example of using statement in C#.

using static System.Console;

namespace StaticClassUsing
{
    class Program
    {
        static void Main(string[] args)
        {
            WriteLine("With using statement");
        }
    }
}

And below is output when you run your application.

You can find all the examples related to C# 6.0 new features at following location on github.
https://github.com/dotnetjalps/Csharp6NewFeatures

That’s it. Stay tuned for more I am going to post lot more new features blog post for C# 6.0