class Student extends Person {
private int graduationYear = 2018;
public static void main(String[] args) {
Student myObj = new Student();
System.out.println("姓名: " + myObj.fname + " " + myObj.lname);
System.out.println("邮箱: " + myObj.email);
System.out.println("年龄: " + myObj.age);
System.out.println("毕业年份: " + myObj.graduationYear);
}
}
class Person {
protected String fname = "Bill";
protected String lname = "Gates";
protected String email = "bill@w3school.com.cn";
protected int age = 24;
}