


















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



















PrintWriter out = new PrintWriter( new FileWriter( dstFileName, false ), true );
// With append to an existing file PrintWriter outFile1 = new PrintWriter( new FileWriter(dstFileName,true),false);
// With autoflush on println PrintWriter outFile2 = new PrintWriter( new FileWriter(dstFileName,false),true);
outFile1.println( “appended w/out flush” ); outFile2.println( “overwrite with flush” );
BankAccount b =.. .;
ObjectOutputStream out = new ObjectOutputStream( new FileOutputStream("bank.dat"));
out.writeObject(b);
ClassNotFoundException
BankAccount[] arr = new BankAccount[size];
// Now add size BankAccount objects into arr
out.writeObject(arr);
class BankAccount implements Serializable
{
...
}
“25” can be turned into the integer 25