coursesToSelect1.addAll(2, Arrays.asList(course2));
asList 显示这个The method asList(Course[]) is undefined for the type String
该怎么解决
The method asList(Course[]) is undefined for the type String.
1、检查是否导进包:import java.util.Arrays;
2、Arrays.asList(collection c),检查你的course2是否为数组集合类型
我没看见代码,我想是因为你没有建立course2这个数组。在你这行代码前加上:
Course[] course2={new Course("课程编号","课程名称"),new Course("课程编号","课程名称"),};
希望能够帮到您!