Course cr1=new Course("1", "shujujiegou");
courseToSelect.add(cr1);
Course temp=(Course)courseToSelect.get(0);
System.out.println(temp.toString());
System.out.println(temp.id+" "+temp.name);
复写Course类中的toString方法
@Override public String toString() { return "Course [id=" + id + ", name=" + name + "]"; }