这里把Object换成Course类为什么不行呢?
/**
* 通过for each
*/
public void testForEach(){
for(Object obj:courseToSelect){
Course cr = (Course) obj;
System.out.println("mm课程:"+cr.id+cr.name);
}
}
/**
* 通过for each
*/
public void testForEach(){
for(Object obj:courseToSelect){
Course cr = (Course) obj;
System.out.println("mm课程:"+cr.id+cr.name);
}
}
2016-03-09
举报