为什么运行后说我类型强制转换异常?
package com.imooc; import java.util.ArrayList; import java.util.List; public class Courseselect { public List selectCourse; public Courseselect(){ this.selectCourse =new ArrayList(); } public void test(){ Course cr1=new Course("1","西游记"); selectCourse.add("cr1"); Course temp=(Course)selectCourse.get(0); System.out.println("已添加课程:"+temp.id+":"+temp.name); } public static void main(String[] args){ Courseselect i=new Courseselect(); i.test(); } }
没发现哪里有错