标题: 【重庆JavaEE07期】Day2作业 [打印本页] 作者: Ely 时间: 2017-12-7 21:42 标题: 【重庆JavaEE07期】Day2作业 public class Demo {
public static void main(String[] args) {
new Student().work();
new Worker().work();
new StudentLeader().meeting();
}
}
abstract public class Person_1 {
private String name;
private String gender;
private int age;
private String nationality;
public abstract void work();
public void eat(){
}
public void sleep(){
}
}
class Student extends Person_1 {
private String school;
private int stuNumber;
@Override
public void work() {
System.out.println("学生在学习");
}
}
class Worker extends Person_1{
private String unit;
private int workAge;
@Override
public void work() {
System.out.println("工人在盖房子");
}
}
class StudentLeader extends Student{
private String job;
public void meeting(){
System.out.println("学生干部喜欢开会");
}
} 作者: 渝小妹 时间: 2017-12-8 08:54
good good study day day up作者: 花开的季节 时间: 2017-12-8 09:53
平时多敲代码作者: 1414225997 时间: 2017-12-8 10:43
路过~显然我看不懂。。。