📌  相关文章
📜  线程“main”java.lang.indexoutofboundsexception 中的异常:索引 1 超出长度 1 的范围 - Java 代码示例

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

代码示例1
0 means you are trying to access index 0 which is invalid, which in turn means the array is empty.
 String[] names = new String[0]; // thats the problem
 String[] names = new String[somelength];//this is true usage