What you want to do in for loop is initialize counter (say your x) to go from 0 to the last index value of an array (note that you can get length of an array with array.length). Then inside your loop you would access and print out value that is stored in the array at position (index) specified by x, not x + 1.
Also, please read UseCodeTags (<-click) and edit your post accordingly so the code will be easier to read.
And, welcome to the Ranch!
The quieter you are, the more you are able to hear.
Joined: Oct 21, 2012
Thank you for your help, I finally solved the problem.
Thank you very much!
Joined: Oct 13, 2005
I have added code tags, and you can see how much better it looks. Why are you returning null? That is a potentially dangerous practice. That method ought to have void for its return type.