The Java training online
Try to work with the helping elements before looking at the solution…
Helping elements
write ()
or writeTrees ()
static
method located in Training
(List trees, String fileName)
java.io.BufferredWriter
BufferedWriter out = new BufferedWriter(new FileWriter(fileName));
'\t
' or in a String: “\t”
#
z = 0
out.write (line); out.newLine ();
SpatializedTree
String line = “” + t.getId () + tab + …
out.close ();
try {} catch () {}
clauseSystem.out.println (…)
then throw the exception back to callermain()
after the previous exercise where you built a list of trees, and write the trees in a file called trees.txt
A possible solution