- 用在类的属性、实例方法或实例构造方法中,区分成员名和本地变量(或参数)。this.XXX
- 表示当前对象。 传递参数的时候,可以直接用。
- 索引器
class Rectangular{public float x;public float y;public float this[int index]{set{switch (index){case 0:this.x = value;break;case 1:this.y = value;break;}}}}Rectangular rect =new Rectangular ();
rect[0] =1;