20.12.31

544 ワード

IO
Input
Output

書き込み順序:ObjectInputStreamois=new ObjectInputStream;
FileReader fr = null;
try {
 fr = new FileReader(“books.dat”);
 중간 생략
}catch(IOException e){
 e.printStackTrace();
}finally{
 try{
 fr.close();
 }catch(IOException e){
 e.printStackTrace();
 }
}
try(FileReader fr = new FileReader(“books.dat”)) {
중간 생략
}catch(IOException e){
 e.printStackTrace();
}