Practice pieces


IO

Ok, so here's the simplest way of doing this:

IO.java

Note that the code double checks whether the String is "", so the last line isn't written to the file.


 

Can you finish this off by:

1) Getting the program to use a path and/or filename passed in through String args[].

2) Getting the program to use a FileDialog when nothing is passed in through String args[].