A good answer might be:

The blanks are filled, below.

Checking Command Line Arguments

Of course, you can use any names for the arguments of the catch{} clauses. The blocks have to be in the given order since FileNotFoundException is a child class of IOException Also, the blocks should actually do something.

    try
    {
        . . . . 
    }
    catch(  FileNotFoundException nfx  )
    {
    }

    catch(  IOException iox  )
    {
    }

All that remains is to check the command line arguments. The command line looks like this:

java copyBytes sourceFile to destinationFile

Here is the part of the program that checks that the command line is correct:

    if ( _________________ _____ _________________  )
    {
      System.out.println("java CopyBytes source to destination");
      return;
    }

Sadly, 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 20:

Fill the blanks. The error message is written out when the command line is incorrect.

Click Here after you have answered the question