今天在学习java时知道了在普通无参方法中虚拟机会隐式的调用一个参数——this,但是我不清楚这个this代表了什么,希望大神相助
2条回答 默认 最新
threenewbee 2016-10-04 14:12关注this代表当前对象实例。 比如 class A { private int x; public void foo() { this.x = 123; } } 可以看作 class A { private int x; public void foo(A this) //这个this参数没有写出来 { this.x = 123; } }本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报