The code would be better if that method threw an exception when there is a problem with the input instead of ignoring the problems and returning bad data.
Also comments in the code re the expected...
Type: Posts; User: Norm
The code would be better if that method threw an exception when there is a problem with the input instead of ignoring the problems and returning bad data.
Also comments in the code re the expected...
To see what print statement is printing the null, add unique ids with each print statement. For example:
System.out.println("p="+p);
...
System.out.println("a="+a);
Why? What...
Basically make sure there is an element at index 0 before trying to access it.
How are you debugging the code to see what it is doing?
I use print statements. Add lots of print statements to...