这是我的文件的代码(在Runnable类中)的一部分。它应该打印1997行数据,但它只写了大约1000行。 此代码未返回任何异常错误,因此我不知道是什么原因导致此故障。我也尝试过制作Main类的这一部分,它有同样的问题。有一点暗示为什么会发生这种情况是文件达到8 kb的数据,但我不确定。但如果你知道解决这个问题的方法,请告诉ne,因为我不知道如何按照我想要的方式工作。
Main ma=new Main();
/*most variables were taken from the main class
These variables are:
ma (Main class object )(created so I can call variables from the Main Class)
ma.scrn (Main class int=0)
ma.save (Main class Formatter)
ma.used (Main class ArrayList <String>)
*/
while(ma.scrn<1996){
Formatter save=ma.save;
save.format("%d", ma.scrn+1);
save.format("%s", " ");
save.format("%s",ma.used.get(ma.scrn));
save.format("%s","\r\n");
ma.scrn+=1;
TimeUnit.MILLISECONDS.sleep(10);
}