???????super???ó???????
????super??parameter-list????
????parameter-list????????й???????????κ??βΣ?super????????????????????????е??????????????????κ??????????????????super?????????????е??????????????????????????
???????????????????super???????????????????????????磺C????B??B????A????C?????????????super??????B??????????
????????????super?????????????????????????????βΣ?????????
???????磺
<span style="font-size:14px;">public class test {
public static void main(String [] args){
new Teacher("one"?? 62);
new Teacher("two"?? 180);
new Teacher("three"?? 65?? 188);
}
}
class Human {
static private float weight;
static private int height;
Human(float weight){
Human.weight = weight;
System.out.println(Human.weight);
}
Human(int height){
Human.height = height;
System.out.println(Human.height);
}
Human(float weight?? int height){
Human.weight = weight;
Human.height = height;
System.out.println(Human.weight + " " + Human.height);
}
}
class Teacher extends Human {
static private String s;
Teacher(String s?? float weight){
super(weight);
Teacher.s = s;
System.out.println(Teacher.s);
}
Teacher(String s?? int height){
super(height);
Teacher.s = s;
System.out.println(Teacher.s);
}
Teacher(String s?? float weight?? int height){
super(weight?? height);
Teacher.s = s;
System.out.println(Teacher.s);
}
}
</span>
?????????
????62
????one
????180
????two
????65.0 188
????three