如何初始化ArrayList
最近遇到一个问题ArrayList list = new ArrayList(5);list.add(2,"zs");而居然出现了如下的异常Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 2, Size: 0 at java.util.ArrayList.rangeCheckForAdd(Unknown Source) at java.util.ArrayList