我正在尝试读取 .txt 文件,但是当我使用调试器时,它会卡在下一行?我在做一些逻辑错误吗?它都通过多个对象存储到一个数组中:
public static File readFileInfo(Scanner kb)throws FileNotFoundException
{
System.out.println("Enter your file name");
String name = "";
kb.nextLine();
name = kb.nextLine();
File file = new File(name);
return file;
}
我传入的扫描仪是:
Scanner fin = null, kb = new Scanner(System.in);
File inf = null;
inf = FileUtil.readFileInfo(kb);
fin = new Scanner(inf);