go to previous page   go to home page   go to next page

Answer:

It must unread() (push back) the character.


Testing Program

Here is a testing program for the scanner. It merely prints tokens to the monitor. The name of the HTML file it examines comes from the command line.

import java.io.*;

class WebScannerTester
{
  public static void main ( String[] args ) throws _________________
  {
    FileReader fr;
    String     token;
    WebScanner wbs;

    if ( args.length != 1 )
    {
      System.out.println("tester inputFile");
      System.exit( -1 );
    }

    fr = new _________________( args[0] );

    wbs = new WebScanner( fr );

    while ( (token = wbs._________________()) != null )
    {
      System.out.println( ":" + token );
    }
  }
}

QUESTION 10:

Fill in the blanks.