java.lang.IndexOutOfBoundsException: Index: 1, Size: 0 at java.util.ArrayList.add(ArrayList.java:483)
//if Your arrayList is empty. its crashing
yourlist.add(1,"data");
//you can use this code
yourlist.add("data");
Are there any code examples left?
New code examples in category Java