**Java继承的总结**
package javaexam;
import java.util.*;
class Student{
protected int id;
public Student(int id) {
this.id=id;
}
public void out(){
System.out.print(id);
}
public void print() {};
}
class Person extends Student{
private String name;
public Person(int id,String name) {
super(id);
this.name=name;
}
public void print() {
super.out();
System.out.println(" "+name);
}
}
public class javapractise {
public static void main(String[] args) {
Scanner reader=new Scanner(System.in);
int id=reader.nextInt();
String name=reader.next();
Student per=new Person(id,name);
per.print();
}
}