为什么是temp的id和name,不是cr1的id的id和name?
package com.imooc.cellection;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
public class ListTest {
public List coursesToSelect;
public ListTest(){
this.coursesToSelect = new ArrayList();
}
public void testAdd(){
Course cr1 = new Course("1","数据结构");
coursesToSelect.add(cr1);
Course temp = (Course)coursesToSelect.get(0);
System.out.println("添加了课程:"+temp.id+":"+temp.name);