|
Re: Random "Letter" Generator
double number = Math.round((Math.random() * 100));
char a = (char)(number);
System.out.println(a);
Yes... if you force it within the correct range, you can generate a letter between A-J only using Math.random() and converting it to char. The code I provided above isn't in the correct range, but it demonstrates what I mean. I hope I'm not overlooking something else in your code that requires the array. But just a thought.
|