8.4 this关键字

成员变量和局部变量同名的问题: 当在方法中出现了局部变量和成员变量同名的时候, 可以在成员变量名前面加上 this. 来区别成员变量和局部变量 class Person {     private intage;     private String name;         public voidspeak() {         this.name = "小强";         this.
相关文章
相关标签/搜索