<分区>
Possible Duplicate:
When do you use the “this” keyword?
如果我有下面的例子:
public class MyClass {
private void MyMethod1()
{
...
}
private void MyMethod2()
{
this.MyMethod1();
...
}
在“MyMethod2”中使用“this.MyMethod1()”或仅使用“MyMethod1()”有区别吗?性能、安全性、良好实践或其他什么?我问这个,因为通常我不使用“this”来调用同一个类中的方法,但我得到了使用它的其他人开发的代码......也许我错了......或者不是!
抱歉,这个问题看起来很愚蠢,但毕竟我“很好奇”。谢谢!