把test.java救回来了
This commit is contained in:
+10
-10
@@ -1,10 +1,10 @@
|
||||
//Person.java
|
||||
package Task5;
|
||||
|
||||
public abstract class Person {
|
||||
String name;
|
||||
String gender;
|
||||
String birthday;
|
||||
|
||||
public abstract void printInfo();
|
||||
}
|
||||
//Person.java
|
||||
package Task5;
|
||||
|
||||
public abstract class Person {
|
||||
String name;
|
||||
String gender;
|
||||
String birthday;
|
||||
|
||||
public abstract void printInfo();
|
||||
}
|
||||
|
||||
+17
-17
@@ -1,17 +1,17 @@
|
||||
//Student.java
|
||||
package Task5;
|
||||
|
||||
public class Student extends Person {
|
||||
String school;
|
||||
String id;
|
||||
String grade;
|
||||
|
||||
public void printInfo() {
|
||||
System.out.println("name:\t" + this.name);
|
||||
System.out.println("gender:\t" + this.gender);
|
||||
System.out.println("birthday:\t" + this.birthday);
|
||||
System.out.println("school:\t" + this.school);
|
||||
System.out.println("id:\t" + this.id);
|
||||
System.out.println("grade\t" + this.grade);
|
||||
}
|
||||
}
|
||||
//Student.java
|
||||
package Task5;
|
||||
|
||||
public class Student extends Person {
|
||||
String school;
|
||||
String id;
|
||||
String grade;
|
||||
|
||||
public void printInfo() {
|
||||
System.out.println("name:\t" + this.name);
|
||||
System.out.println("gender:\t" + this.gender);
|
||||
System.out.println("birthday:\t" + this.birthday);
|
||||
System.out.println("school:\t" + this.school);
|
||||
System.out.println("id:\t" + this.id);
|
||||
System.out.println("grade\t" + this.grade);
|
||||
}
|
||||
}
|
||||
|
||||
+15
-15
@@ -1,15 +1,15 @@
|
||||
//Teacher.java
|
||||
package Task5;
|
||||
|
||||
public class Teacher extends Person {
|
||||
String school;
|
||||
String id;
|
||||
|
||||
public void printInfo() {
|
||||
System.out.println("name:\t" + this.name);
|
||||
System.out.println("gender:\t" + this.gender);
|
||||
System.out.println("birthday:\t" + this.birthday);
|
||||
System.out.println("school:\t" + this.school);
|
||||
System.out.println("id:\t" + this.id);
|
||||
}
|
||||
}
|
||||
//Teacher.java
|
||||
package Task5;
|
||||
|
||||
public class Teacher extends Person {
|
||||
String school;
|
||||
String id;
|
||||
|
||||
public void printInfo() {
|
||||
System.out.println("name:\t" + this.name);
|
||||
System.out.println("gender:\t" + this.gender);
|
||||
System.out.println("birthday:\t" + this.birthday);
|
||||
System.out.println("school:\t" + this.school);
|
||||
System.out.println("id:\t" + this.id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
//TestPerson.java
|
||||
package Task5;
|
||||
|
||||
public class TestPerson {
|
||||
public static void main(String[] args) {
|
||||
Student s1 = new Student();
|
||||
s1.name = "Jason Fate Chen";
|
||||
s1.gender = "male";
|
||||
s1.birthday = "May.5th.2005";
|
||||
s1.school = "XJIT";
|
||||
s1.id = "202301130071";
|
||||
s1.grade = "1";
|
||||
s1.printInfo();
|
||||
Teacher t1 = new Teacher();
|
||||
t1.name = "White";
|
||||
t1.gender = "female";
|
||||
t1.birthday = "Mar.7th.1993";
|
||||
t1.school = "Tsinghua";
|
||||
t1.id = "199303071145";
|
||||
t1.printInfo();
|
||||
}
|
||||
}
|
||||
//TestPerson.java
|
||||
package Task5;
|
||||
|
||||
public class TestPerson {
|
||||
public static void main(String[] args) {
|
||||
Student s1 = new Student();
|
||||
s1.name = "Jason Fate Chen";
|
||||
s1.gender = "male";
|
||||
s1.birthday = "May.5th.2005";
|
||||
s1.school = "XJIT";
|
||||
s1.id = "202301130071";
|
||||
s1.grade = "1";
|
||||
s1.printInfo();
|
||||
Teacher t1 = new Teacher();
|
||||
t1.name = "White";
|
||||
t1.gender = "female";
|
||||
t1.birthday = "Mar.7th.1993";
|
||||
t1.school = "Tsinghua";
|
||||
t1.id = "199303071145";
|
||||
t1.printInfo();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user