Your for loop is totally different from what you want. This code should produce ArrayIndexOutOfBoundsException after printing value 12.
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!