为什么"for(Course cr:student.courses) "老是报错啊?错误类型是“Type mismatch: cannot convert from element type Object to Course”
public void testForEachForSet(Student student) { // 打印输出,学生所选的课程! System.out.println("共选择了:" + student.courses.size() + "门课程!"); for(Course cr:student.courses) { System.out.println("选择了课程:" + cr.id + ":" + cr.name);