The Java training online

Back to the table of contents

8. Pass parameters on the command line

Purpose: check and interpret the user parameters on the command line

Statement of the exercise:

  1. in the main() method of exercise 1, now expect 4 parameters, a number of trees, a xSize, a ySize and a file name
  2. manage the possible errors during their interpretation
  3. use them to create the tree list and write it to the file

Helper and solution

Back to the table of contents