package objectOriented; public class thisCall { * @param args * this语句只能定义在构造函数第一行this(name) * 初始化动作要先执行 public static void main(String[] args) { // TODO Auto-generated method stub Person p1 = new Person("张三",12); } } class Person{ private String name; private int age; Person(String name){ this.name=name; } Person(String name,int age){ this(name); //构造函数间调用只能用this语句,此句调用Person(String name) this.age=age; System.out.print(name+" "+age); } }