7._write_the_trees_in_a_file
The Java training online
7. Write the trees in a file
Purpose: Write text in a file
Statement of the exercise:
- build a tool method accepting in arguments a list of
SpatializedTrees
and afileName
, to write a line in the file per tree in the list. - each line contains the tree
id
,age
,x
,y
,z
,height
,dbh
,crownBaseHeight
andcrownRadius
of the tree, all columns are separated by tabs. - a header line starting with a
#
comment mark displays the column names - in case of trouble, an error message is written in the terminal and the exception is thrown back to the caller.
- write the previous exercise tree list in a file called
trees.txt
7._write_the_trees_in_a_file.txt ยท Last modified: 2021/12/13 09:28 by 127.0.0.1