use of :: operator

Ddd
Posted by Ddd under C# category on | Points: 40 | Views : 1722
//if we have System as the class and Console as the static variable, so

// how can we write System.Console.WriteLine.

//The operator :: is known as the namespace alias qualifier.

//global is the namespace.

// :: is used between global and System namespaces


namespace dd
{
class System
{
static int Console=10;
static void Main()
{
global::System.Console.WriteLine(Console);

}
}

}
//output will be 10.

Comments or Responses

Login to post response