Keeping data in memory
I am writing a program that automatically generates letters, requests the user to enter and compared with one another, but at the time of the comparison, they are no longer there, only the latter is kept in memory. How can I do for store all caracters?
static int aleatoire;
static Random generateur = new Random();
final static char lettresAleatoires =
'R', 'B', 'O', 'V', 'J', 'F', 'I', 'N'
for (int i = 0; i < 3; i++)
private static void genererLettres()
aleatoire = generateur.nextInt(8);
// Here I put the letters in a table, but I don't know how to do this
You store things by putting them into variables including simple primitive variables, reference variables, arrays, collections such as array lists, and so forth. Your code above won't compile, by the way as you appear to have a for loop hanging in no-man's land.