edit: the input is always lower as max array (0-50) my main method:
int [] rndm1 = readUserTip();
for(int i = 0; i<49;i++)
{
System.out.print(rndm1[i]);
}
System.out.println();
I try to get this working with a user input but console says always:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException:"
I know what the error means but it only happens when i use input method..
static int [] readUserTip() {
char input;
int[] readUserTip = new int[50];
for (int i = 0; i <= 6;) {
input = In.readChar("Input Number: ");
readUserTip[input] = 1;
i++;
}
realharry fixed it thanks a lot ! char -> int see his answer :)