* this,特殊的变量 用来调用方法名
* 主要是用来解决成员变量和局部变量名冲突问题的,this调用的是成员变量
* 那个对象调用这个方法,this就拿到那个对象
public class Student {
String age;
public Student(){
}
public Student(String age){
this.age =age;
}
}
public static void main(String[] args) {
Student s = new Student("18");
System.out.println(s.age);
}

被折叠的 条评论
为什么被折叠?



