Saturday, 13 May 2017

Understanding "USING" keyword in c# programming

The keyword USING is similar to #INCLUDE in c programming to add the namespaces into the program which we are going to execute. We can write programs without using this keyword too. The bellow two example show how the code is changed with and without including the "USING" keyword in the program.

The program with "USING" keyword:

using System;
class SimpleHelloWorld
{
    static void Main()
    {
        Console.WriteLine("Hello World!");
    }
}




The program without "USING" keyword:

class WithoutUsing
{
    static void Main()
    {
        System.Console.WriteLine("Hello World!");
    }
}