请我有一个proble,这是我到目前为止的代码我不能把串中的字符串数组的第一个位置
System.out.println("Please give alue for the table");
int value = scanner.nextInt();
String[] StringArray = new String[value];
for (int i=0; i<value; i++)
{
System.out.println("Please insert string for the position:"+(i+1));
StringArray[i] = scanner.nextLine();
}
}
而且我的输出是
Please give alue for the table
3
Please insert string for the position:1
Please insert string for the position:2
为什么我不能插入字符串到位置1和我的程序让我在位置2和之后? 我需要帮助,我不能unsterstand。 谢谢你的时间。
非常感谢队友,我解决我的问题 –
@ILOVEJAVA如果它帮助你,请记住[标记答案已被接受](https://meta.stackexchange.com/a/5235/208693) – BackSlash