2011年8月30日
摘要: 以下是 this 的常用用途:this 关键字引用类的当前实例,还可用作扩展方法的第一个参数的修饰符。限定被相似的名称隐藏的成员,例如:public Employee(string name, string alias){ // Use this to qualify the fields, name and alias: this.name = name; this.alias = alias;}将对象作为参数传递到其他方法,例如:CalcTax(this);声明索引器,例如:public int this[int param]{ get { return array... 阅读全文
posted @ 2011-08-30 17:04 wangjy 阅读(243) 评论(0) 推荐(0) 编辑