我正在尝试将两个数组列表的内容保存到学校项目的文件中,一个是整数类型的,另一个是字符串类型的。这是我现在所拥有的.请记住,数组列表的变量名为字符串数组的list和整数数组的listquanity
case ("6"):
{
final String FNAME = ("C:\\Users\\Neil\\Documents\\Eclipse Workspace\\Final Project Market Stocks\\stocks.txt");
PrintWriter bw = null;
try
{
bw = new PrintWriter(new File(FNAME));
for (int g = 0; g<= list.length(); g++){
Printwriter.write();
}
}catch (IOException e) {
e.printStackTrace ();
}finally{
if (bw != null){
bw.flush();
bw.close();
}
}
}
System.out.println("Saving...");
//System.exit(0);
break;
https://stackoverflow.com/questions/53771646
复制相似问题