Teach your self programming in ten years ? ;)
Type: Posts; User: PhHein
Teach your self programming in ten years ? ;)
int[] numbers = new int[8]; this is an array of length 8, i.e. the index range is [0,7]. You're trying to access index 8.
One hint don't google, but go straight to the API docs: String.split()
12121314503 is 11 chars so there must be two 2 digit numbers or one 3 digit number to fit into his 3x3 matrix. Or he has to omit remaining digits. Whatever, without him specifying the exact problems...
Hmm, in the OP he had a 13 and a 50, so that would rule out the charAt() solution.
You can either user String.split() to get a String array containing the individual numbers as Strings, or you can use String.replaceAll() to get rid of the spaces. I'd use the split version.