I am running a traversal of a JTree trying to find a certain node. When I do find that node I want to return true, indicating that I did in fact find it. The code below always returns false indicating to me that even though I return true when the item is found the loop continues to run.
Here is the print out of the test code. Match Found! No Match Found 1 No Match Found 1 false <------- a printout from what is returned.
Any ideas? Thanks, Casen
Joined: Jan 22, 2004
Ok, I see why it isn't working. I am calling multiple instance of the method therefore it would return a value for each one of them; the last one being false.
The question still remains, how can I manipulate the code so that once a match is found it would return true and stop the recursion?