泛型加入课程对象为什么总报错
import java.util.*;
public class TestGeneric {
public List<Course> courses;
public void TestGeneric(){
courses=new ArrayList<Course>();
}
public void testAdd(){
Course c1=new Course("1","课程1");
courses.add(c1);
Course c2=new Course("2","课程2");
courses.add(c2);
}
courses.add(c1);为什么这行总报错