纸上得来终觉浅,绝知此事要躬行。

 

2010年8月16日

C#中This的用法

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 第一个this的意思是调用Car(int petals)方法的属性petals。 2 第二个this的意思是实例化Car(String s, int petals)方法中的参数s(this.s = s)。 3 第三个this是调用Car(String s, int petals)方法的两个参数并传参。 4 5 在C#中,this关键字代表当前实例,我们可以用this.来调用当前实例的成员. 阅读全文

posted @ 2010-08-16 10:20 JRoger 阅读(31665) 评论(2) 推荐(5) 编辑

导航