2 Star 0 Fork 0

CS-IMIS-23/zc20172324

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
POSTester2.java 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
zc20172324 提交于 7年前 . pp6.17
package chap6;
import java.io.IOException;
public class POSTester2 {
public static void main(String[] args) throws IOException {
ProgramOfStudy2 pos = new ProgramOfStudy2();
System.out.println("判断是否为空:"+pos.isEmpty());
System.out.println("列表长度:"+pos.size());
pos.addCourse(new Course("CS",101,"Introduction to Programming","A-"));
pos.addCourse(new Course("ARCH",305,"Building Analysis","A"));
pos.addCourse(new Course("GER",210,"Intermediate German"));
pos.addCourse(new Course("CS",320,"Computer Architecture"));
pos.addCourse(new Course("THE",201,"The Theatre Experience"));
System.out.println("打印课表");
System.out.println(pos.toString());
Course contains = new Course("CS",320,"Computer Architecture");
System.out.println("判断是否有CS 320,\"Computer Architecture\"");
pos.contains(contains);
System.out.println("第一个列表元素:"+pos.first());
System.out.println("最后一个列表元素:"+pos.last());
pos.remove(contains);
System.out.println("去掉元素CS 320,\"Computer Architecture\"后的列表:"+"\n "+pos.toString());
pos.removeFirst();
pos.removeLast();
System.out.println("去掉头和尾之后的列表:"+"\n"+pos.toString());
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/CS-IMIS-23/zc20172324.git
git@gitee.com:CS-IMIS-23/zc20172324.git
CS-IMIS-23
zc20172324
zc20172324
master

搜索帮助