阵列我有距离d文件:\ input.txt中 我想是我的代码,但我recevie ArrayIndexOutOfBoundException 为什么从用户那里得到这条道路与扫描仪类 这里?店字符串中使用扫描仪
if(args.length != 0)
{
readerWriter.readFile(args[0]);
}
else
{
System.out.println("Plese enter the path of your file");
Scanner filePath = new Scanner(System.in);
args[0] = filePath.next();
readerWriter.readFile(args[0]);
}
你是怎么跑的? –
@mahdieh你在哪一行得到ArrayIndexOutOfBoundException? –