Please enable JavaScript.
Coggle requires JavaScript to display documents.
构造器(Student) (构造方法重载 (public 类名() {}, public 类名(参数类型 参数名) {}, public…
构造器(Student)
构造方法重载
-
-
public 类名(参数类型 参数名,参数类型 参数名, ....) {}
public Student(String s,int a,String sex) {}
-
-
构造方法的调用
构造器名 对象 = new 构造器名();
Student s = new Student();
Student s1 = new Student("wang liu",20,"女");
System.out.println(s3.name+":"+s3.age);
-
-
-