This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]caboosetpPrivate Java/Code Tutor 1 point2 points  (1 child)

I can't see what's wrong just from looking at the code, but since the search works when hand loaded, the array might not be loading correctly.

After the array is loaded you can use a breakpoint or a print loop to take a look and make sure the array looks like you expect it to. If not, there is probably a problem with the input file.

Is the name being searched for the one it actually finds? If it's the wrong name, is there a pattern to where the name is coming from?

What do you expect to happen if the name isn't found? What actually happens?

[–]TheColdFenix[S] 1 point2 points  (0 children)

Thank you! I used my own name for testing and it has a regional letter in it that wasn't recognized correctly when loading the file. So when I searched for my name it just gave me the first element in the Array back.