📜  java.lang.IndexOutOfBoundsException:索引:1,大小:0 在 java.util.ArrayList.add(ArrayList.java:483) - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:45.512000             🧑  作者: Mango

代码示例1
//if Your arrayList is empty. its crashing
yourlist.add(1,"data");

//you can use this code
yourlist.add("data");