-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();
}
}
}
程序進入無限循環。