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
Random r = new Random(); char c = r.nextBoolean() ? 'v' : 'h';
N.B. construct your Random object once and re-use it; don't re-construct it every time you want a random number!