Here is a little snippet of my code, which is attempting to convert a length 6 string into an int array.
int[] intArray=new int[6];
int i = 0;
String s = jTextField2.getText();
int strLength = s.length();
if(strLength != 6) {
jTextArea1.setText("Not a valid length");
} else {
for(i=0;i<6;i++) {
intArray[i] = Integer.parseInt(String.valueOf(s.charAt(i)));
}
}
This comes up with an out of bounds exception and I cant understand why.
Thanks for any help.