Java: Generating a random char (a-z)

A random character between 'a' and 'z':

Random rnd = new Random();
char c = (char) (rnd.nextInt(26) + 'a');

A random character from an arbitrary string of characters:

String chars = "abcxyz";
Random rnd = new Random();
char c = chars.charAt(rnd.nextInt(chars.length()));

See also

Comments