This 的用法 this(); 用于调用重载的构造方法,只能在构造器方法中使用,且必须在第一行,super()调用父类的无参构造器;this 不能再 static 方法中使用,因为staic在方法区中,找不到this,普通方法会默认传入this作为隐式参数;普通方法中 this 指向调用该方法的对象,构造方法中,this 指向准备初始化的对象。 public class TestThis { int a,b,c; public TestThis() { this(2); // 调用有参构造器 System.out.println("空参构造方法初始化对象:" + this); } public TestThis(int a){ //this(); //调用无参构造器 System.out.println("有参构造方法初始化对象:" + this); this.a = a; } public void Test(){ System.out.println("普通方法对象:" + this); } public static void main(String[] args) { TestThis testThis = new TestThis(); testThis.Test(); } }