class Person {
private String name;
public Person(String name) {
this.name = name;
}
String getName() {
return name;
}
void print() {
System.out.printf(“Name: %s\n”, name);
}
}
class Student extends Person {
private static int maxIdSoFar = 0;
private int id;
public Student(String name) {
super(name);
this.id = ++maxIdSoFar;
}
@Override
void print() {
System.out.printf(“Name: %s, id %d\n”, getName(), id);
}
}
class Main {
public static void main(String args) {
Person p0 = new Person (“Alice”);
Person p1 = new Student (“Bob”);
p0.print();
p1.print();
}
}