use*_*246 1 java this operator-keyword
我对 Java 中的 this 运算符有疑问。如果程序员会编写这样的代码:
private int counter;
public Incrementor(int counter){
this.counter = counter;
}
Run Code Online (Sandbox Code Playgroud)
避免阴影效果并使用这个会更好吗:
private int counter;
public Incrementor(int startValue){
counter = startValue;
}
Run Code Online (Sandbox Code Playgroud)
this 运算符不会在未来的编程执行中使 this 运算符过时吗?
| 归档时间: |
|
| 查看次数: |
9793 次 |
| 最近记录: |