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

Answer:

Three.


Checking Command Line Arguments

The command line looks like this:

java copyBytes sourceFile to destinationFile

Here is how the program checks the command line:

public static void main ( String[] args ) 
{
  DataInputStream  instr;
  DataOutputStream outstr;
  
  if (        )
  {
    System.out.println("java CopyBytes source to destination");
    return;
  }
  
  . . .

There are three blanks which must be filled. Here is a list of possible blank-fillers:

args.length == 3
args.length != 3
args[1].toUpperCase().equals("TO")
!args[1].toUpperCase().equals("TO")
&&
||

QUESTION 22:

Fill the blanks (use copy and paste) so that the error message is written out when the command line is incorrect.