class Student{
public String name;
public int age;
public String setNum;
public Student(){
System.out.println("不带参数的构造方法......");
}
//利用idea的高效开发效率,右键选生成,选择构造函数,直接生成。
public Student(int age, String setNum, String name) {
this.age = age;
this.setNum = setNum;
this.name = name;
System.out.println("不带参数的构造方法......");
}
}
public class Test {
public static void main(String[] args) {
Student student1 = new Student();
Student student2 = new Student(19,"1234","zhangsan");
}
}