global:: 举例

namespace Practise
{
    public class Program
    {
        static void Main(string[] args)
        {
            global::System.Console.WriteLine(number);

            //错误写法,因为Practise.Program隐藏了System命名空间
            //global::System.Console.WriteLine("45");

        }

        public class System { }

        // Define a constant called 'Console' to cause more problems.
        const int Console = 7;
        const int number = 66;

    }
}

你可能感兴趣的:(global:: 举例)