} // end method deleteRecord
// read and display records
public void readRecords()
{
RandomAccessAccountRecord record = new RandomAccessAccountRecord();
System.out.printf( "%-10s%-15s%-15s%10s\n", "Account",
"First Name", "Last Name", "Balance" );
try // read a record and display
{
file.seek( 0 );
while ( true )
{
do
{
record.read( file );
} while ( record.getAccount() == 0 );
// display record contents
System.out.printf( "%-10d%-15s%-15s%10.2f\n",
record.getAccount(), record.getFirstName(),
record.getLastName(), record.getBalance() );
} // end while
} // end try
catch ( EOFException eofException ) // close file
{
return; // end of file was reached