继承与方法重写
掌握类的继承与父类子类之间的方法重写
- 在github的lab仓库https://github.com/Java-B-2018/lab8中已经给出了你需要完成的工程。
src
文件夹下包含五个java类。 - 你需要在
Freshman
类、Sophomore
类、Junior
类在有//your code here
的地方填充你的代码,并对Student
类做适当修改(添加一些必要的方法)。 - 运行
Test.java
使其满足如下的打印输出: - 体现继承与方法重写的特性。
My name is Bob, 17 years old. I'm freshman.
My name is Alice, 18 years old. I'm sophomore.
My name is Jack, 19 years old. I'm junior.
切记:你不能修改
Test.java
的任何内容!
在12月2日23:59
之前将整个工程打包上传至ftp对应目录下。