Re: Print a binary search tree
kaltizer wrote:
...
// Create PrintWriter for the file.
PrintWriter out = new PrintWriter(
new FileWriter(sourceName));
// Write the name(s) to the text file.
// The next line is where the problem is.
// For some reason I get a 'cannot fine symbol' error at
// the selection period before print();
out.print();
Please refrain from posting 'tabs' to usenet. That text
quoted above is indented to slightly beyond the start of
the word 'to' in the first sentence, here.
A tool for helping to format code for usenet is here..
<http://www.physci.org/twc.jnlp>
It includes a button to replace tabs with chars.
<hint>
Now, as far as the comiler error message goes.
Do you see any single 'print()' method in the
PrintWriter class that accepts no arguments?
</hint>
The final comment I have is that you can help encourage
people to assist you by providing an SSCCE*. That example
you posted might have fit most of the requirements of
an SSCCE, but could have been made *much* shorter,
while still displaying the exact error message you are
seeing.
* <http://www.physci.org/codes/sscce.html>
--
Andrew Thompson
http://www.athompson.info/andrew/
Message posted via http://www.javakb.com