已采纳回答 / 异新世
String s角标越界, for (int i=1;i<=s.length();i++ ), s.length()是字符个数,角标是从0开始,所以s的最大角标是s.length()-1, 所以s.charAt(i),取到s.charAt(s.length())时越界,抛出java.lang.StringIndexOutOfBoundsException,即String索引越界异常
2015-09-29
最新回答 / 梁XX
The method asList(Course[]) is undefined for the type String.1、检查是否导进包:import java.util.Arrays;2、Arrays.asList(collection c),检查你的course2是否为数组集合类型
2015-09-25
已采纳回答 / 无动于衷
接口是不能实例化的,但是接口的实现类可以,实现类的实例可以用接口的引用接受,像是这样:List<Student> list = new ArrayList<Student>();也可以这样定义属性:private List<Student> list;只要list后来指向一个实现类的实例就可以了:list = new ArrayList<Student>();
2015-09-24