How do I generate a random character between two specific characters? For e.g; I want to generate either one of \'h\' or \'v\'.
Thanks
how about:
import java.util.Random; .... Random randomGenerator = new Random(); int randomInt = randomGenerator.nextInt(100); char chosen = randomInt % 2 == 0 ? 'h' : 'v';