This line of output looks like the desired results:
The String entered is: BA20
Type: Posts; User: Norm
This line of output looks like the desired results:
The String entered is: BA20
That looks like source code, not the program's output.
How can the code be tested? It needs a class with a main() method.
Can you post the program's output that shows what you are talking about?
How can the code be tested? It doesn't have a class and a main() method.
Have you tried debugging the code to see what it is doing? Add some println() statements that print out the values of variables as their values are changed so you can see what the code is doing....
At line 41 the code uses an index (-1) that is out of bounds. Valid indexes for arrays range in value from 0 to the array length-1.
Look at line 41, find the index and then backtrack in the code to...