-1
这是我的课:扫描仪有一个无限循环
public class class1{
public static void main(String[] args) {
File source = new File("E:\\NUS_WID_Tags\\All_Tags.txt");
File target = new File("fiche1Filtered3.txt");
int i=0;
try {
Scanner s = new Scanner(source);
PrintStream psStream= new PrintStream(target);
while (s.hasNext()) {
System.out.println(i++);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
程序进入无限循环。