Answers to Self-Review Exercises

14.1
  1. ones, zeros.

  2. bit.

  3. file.

  4. characters.

  5. files.

  6. System.err.

14.2
  1. False. These three streams are created for the programmer when a Java application begins executing.

  2. True.

  3. True.

  4. False. Text files are human readable.

  5. True.

  6. False. Class Formatter contains method format, which enables formatted data to be output to the screen or to a file.

14.3
  1. Scanner inOldMaster = new Scanner( new File ( "oldmast.txt" ) );

  2. Scanner inTransaction = new Scanner( new File( "trans.txt" ) );

  3. Formatter outNewMaster = new Formatter( "newmast.txt" );

  4. AccountRecord account = new AccountRecord();

    account.setAccount( inOldMaster.nextInt() ); account.setFirstName( inOldMaster.next() ); account.setLastName( inOldMaster.next() ); account.setBalance( inOldMaster.nextDouble() ...

Get Java™ How to Program, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.