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

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -