class Person{ String name; int age; String address; Person(){ System.out.println("无参数的构造函数"); } Person(String name, int age){ this.name = name; this.age = age; System.out.println("两个参数的构造函数") } Person(String name, int age, String address){ //括号留空,传的是 无参数的构造函数 this(name,age)括号里填了东西是两个参数的构造函数 this(); this.address = address; System.out.println("三个参数的构造函数"); } void talk(){ System.out.println(" my name is" + name); } }