JAVA继承以及super关键字,extends…`
package jj;
class Student{
int Id;
String name;
public Student(int Id,String name) {
this.Id=Id;
this.name=name;
}
}
public class Graduate extends Student{
String supervoior;
public Graduate(int a,String b,String c)
{
super(a,b);
supervoior=c;
}
public static void main(String[] args) {
Graduate hh=new Graduate(66, "djsh", "ss");
System.out.println("学号:"+hh.Id+"姓名"+hh.name+"导师"+hh.supervoior);
}
}