import java.io.*; public class TryClose { public static void main (String [] args) { FileWriter writeInt; writeInt = null; try { writeInt = new FileWriter ("a.txt"); writeInt.close (); } /* catch (FileNotFoundException fnfe) { System.out.println (" fnfe worked "); } */ catch (IOException ioe) { System.out.println (" ioe worked "); } } }