jeudi 7 mars 2019

How can I make a variable a random variable in another variable?

The CL is to get a random Capital Letter & the rest is self explanatory.

String CL = CLetters.get(Randal.nextInt(CLetters.size()));
String L = Letters.get(Randal.nextInt(Letters.size()));
String N = Numbers.get(Randal.nextInt(Numbers.size()));

For some reason the command under this, I know that I could use an if statement, // but then it wouldn't work with the rest of my script or class, I am wanting to use a or statement.

String CLLN = (CL || L || N);




Aucun commentaire:

Enregistrer un commentaire