:: Operator (C# Reference)

The namespace alias qualifier (::) is used to look up identifiers. It is always positioned between two identifiers, as in this example:

global::System.Console.WriteLine("Hello World");

The :: operator can also be used with a using alias directive:

// using Col=System.Collections.Generic;
var numbers = new Col::List<int> { 1, 2, 3 };


The namespace alias qualifier can be global. This invokes a lookup in the global namespace, rather than an aliased namespace.

For More Information

For an example of how to use the :: operator, see the following section:

C# Language Specification

For more information, see the C# Language Specification. The language specification is the definitive source for C# syntax and usage.

See Also