【发布时间】:2011-04-05 14:31:14
【问题描述】:
在 C# .NET 中,为什么我不能使用 'this' 关键字访问类中的常量?
例子:
public class MyTest
{
public const string HI = "Hello";
public void TestMethod()
{
string filler;
filler = this.HI; //Won't work.
filler = HI //Works.
}
}
【问题讨论】: