-3
你好,这是我的代码日食告诉我租用ArrayList
需要是int
,我想打印在出租类的toString()
方法,所以我可以在阵列Java的节能ArrayList的错误
public static void save() {
try {
File file = new File("D:/Assignment/filename.txt");
// If file does not exists then create it
if (!file.exists()) {
file.createNewFile();
}
FileWriter fw = new FileWriter(file.getAbsoluteFile());
BufferedWriter bw = new BufferedWriter(fw);
for(Hire hire:HireList)
bw.write(hire);
bw.close();
System.out.println("Done");
} catch (IOException e) {
e.printStackTrace();
}
}