The Java training online
Try to work with the helping elements before looking at the solution…
Helping elements
main()
method of exercise 1 to process 4 parametersStrings
, in the String[]
parameter of main()
String[] args
, the number of Strings
in the array is args.length
int numberOfTrees, double xSize, double ySize, String fileName
int
value, two double
values and a String
, store them in 4 variablesnew Integer(String).intValue ()
new Double(String).doubleValue ()
int
and value is not an int
…), write an error message in the terminal and throw an exception to the callernumberOfTrees
, xSize
and ySize
to createTrees ()
fileName
A possible solution