gpt4 book ai didi

java - 以前运行的程序,现在给出 ArrayIndexOutOfBounds 异常?

转载 作者:行者123 更新时间:2023-11-29 05:49:34 25 4
gpt4 key购买 nike

我正在尝试运行我的老师在线发布的代码。它将图像作为输入 (BufferedImage img = ImageIO.read(new File(args[0]));

我第一次运行它时它运行良好,现在它在上面的行中给我 ArrayIndexOutOfBounds 异常。

最佳答案

也许您没有向它传递任何命令行参数?那么 args 的长度将为 0,[0] 将导致数组索引越界异常。

关于java - 以前运行的程序,现在给出 ArrayIndexOutOfBounds 异常?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14450368/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com