【发布时间】:2015-05-01 08:24:39
【问题描述】:
我在try-exception 之前声明了Scanner infile,但由于某种原因它说变量可能没有被初始化?
Scanner infile;
try
{
infile = new Scanner(file);
}
catch(FileNotFoundException f)
{
System.out.println("Wrong File Path");
}
while (infile.hasNext())
{
System.out.print("Testing While loop");
【问题讨论】:
标签: java while-loop try-catch java.util.scanner