Article ID: 178639
Article Last Modified on 9/13/2005
import java.io.*;
class Test
{
public static void main(String args[])
{
try
{
FileOutputStream fos = new FileOutputStream("test.txt",
true);
PrintWriter pw = new PrintWriter(fos);
pw.print("This is a test of the "+
"FileOutputStream(String,boolean).\r\n");
pw.close();
fos.close();
FileOutputStream fos2 = new FileOutputStream("test.txt",
true);
PrintWriter pw2 = new PrintWriter(fos2);
pw2.print("Appended text.\r\n");
pw2.close();
fos2.close();
}
catch (IOException ex)
{
System.out.println(ex);
}
}
}
Appended text.
f the FileOutputStream(String,boolean).
Additional query words: FileOutputStream, output, write
Keywords: kbbug kbfix kbsdkjava202fix kbcode KB178639