// Append.java // // Developer's Daily // http://www.DevDaily.com // Copyright 1998 DevDaily Interactive, Inc. All Rights Reserved. import java.io.*; public class Append { //--------------------------------------------------// public static void main (String[] args) { Append a = new Append(); a.appendToCheckbook(); } // end main //--------------------------------------------------// public void appendToCheckbook () { BufferedWriter bw = null; try { bw = new BufferedWriter(new FileWriter("checkbook.dat", true)); bw.write("400:08311998:Inprise Corporation:249.95"); bw.newLine(); bw.flush(); } catch (IOException ioe) { ioe.printStackTrace(); } finally { // always close the file if (bw != null) try { bw.close(); } catch (IOException ioe2) { // just ignore it } } // end try/catch/finally } // end test() } // end class