Я смотрел эту страницу MSDN: Global namespace alias.C# Global Namespace Alias (класс TestClass: global :: TestApp)
У них есть следующий код.
class TestApp
{
// Define a new class called 'System' to cause problems.
public class System { }
// Define a constant called 'Console' to cause more problems.
const int Console = 7;
const int number = 66;
static void Main()
{
// The following line causes an error. It accesses TestApp.Console,
// which is a constant.
//Console.WriteLine(number);
}
}
Они приводят дополнительные примеры.
Я понимаю, как global
используется здесь:
// OK
global::System.Console.WriteLine(number);
Однако, я не понимаю, что следующий делает (особенно, как global::TestApp
и :
используются на одной линии):
class TestClass : global::TestApp
В На странице MSDN говорится о вышеуказанном коде: «следующее объявление ссылается на TestApp как на член глобального пространства»..
Не могли бы вы объяснить это, пожалуйста?
Спасибо.