Why use the global keyword in C#?

前端 未结 3 1508
感动是毒
感动是毒 2020-12-25 09:41

I would like to understand why you might want to use the global:: prefix. In the following code, ReSharper is identifying it as redundant, and able to be remove

3条回答
  •  攒了一身酷
    2020-12-25 10:12

    "The global contextual keyword, when it comes before the :: operator, refers to the global namespace, which is the default namespace for any C# program and is otherwise unnamed."

    Source: https://msdn.microsoft.com/en-us/library/cc713620.aspx

提交回复
热议问题