Why is this line required in Java?
fout.close();
Context:
LinkedList values = new LinkedList(classe.getTurma().values());
if (!values.isEmpty()) {
FileOutputStream fout = null;
String FILE = "TURMA";
try {
fout = new FileOutputStream(FILE);
System.out.println("Tamanhno tuma" + values.size());
ObjectOutputStream oos = new ObjectOutputStream(fout);
oos.writeObject(values);
} catch (FileNotFoundException ex) {
Logger.getLogger(Sistema.class
.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(Sistema.class
.getName()).log(Level.SEVERE, null, ex);
} finally {
try {
fout.close();
} catch (IOException ex) {
Logger.getLogger(Sistema.class
.getName()).log(Level.SEVERE, null, ex);
}
}
}
}