java - Random generator Letters and Integers -


sas pgmr learning java android random generator-'rank amateur'. suppose wish display random of a/b/c/d. suppose random of 1/2/3/4 , 'if 2 display b, if 4 display d'?

you store letters in array. random 1 array.

int dex = new random().nextint(letters.length); string random = (letters[dex]); 

but comes out same.


Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -