This little program gives us something simple to work with. One obvious problem is that it reads lists using Lisp notation, enclosed by parentheses and with spaces between entries, but prints them in Java notation surrounded by square brackets and using commas between entries. A simple extension to the ArrayList class allows us to fix that. This simple class overrides the toString method to make the output look like Lisp.
We need to make a one line change in the read method to use this class:
This version of the ReadDemo program includes these changes.