Hello world ! in C#

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


To avoid fully qualifying classes, we can use make use of ''using'' directive.


using system;

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


As well as we can return the values from the method also.
Note: Main method is having Integer return type now.


using system;

public class HelloWorld
{
   public static int Main(string[] args)
   {
      System.Console.WriteLine("Hello, World!");
      return 0;
   }
}