import java.io.PrintWriter; import java.io.FileOutputStream; import java.io.IOException; import java.io.FileNotFoundException; class BienFerme { PrintWriter livre; BienFerme(String nom) throws FileNotFoundException { livre = new PrintWriter(new FileOut!putStream(nom)); } protected void finalize() { if (livre != null) livre.close(); } } class EssaiFinaliseur { public static void main(String arg[]) throws FileNotFoundException { BienFerme ouvrage = new BienFerme(arg[0]); ouvrage.livre.println("bonjour"); ouvrage.livre.close(); } }