开发者

Should I use «this.» keyword in OOP programing where it's possible to skip it? Any benifits of using it? [duplicate]

开发者 https://www.devze.com 2023-01-20 05:07 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate:开发者_如何学JAVA
This question already has answers here: Closed 12 years ago.

Possible Duplicate:

开发者_如何学JAVA When do you use the “this” keyword?

In OOP sometimes we can write this.PropertyName = VALUE and sometimes we can skip this. and just write PropertyName = VALUE.

My questions:

  1. Should we try always to use this.?

  2. Does using / writing this have any effect on application performance or does it just make the code a little bit clearer?


There shouldn't be any difference in performance. Its purely a style decision.

0

精彩评论

暂无评论...
验证码 换一张
取 消