Java tutorial
//package com.java2s; import java.util.Random; public class Main { private static String generateRandomCharacter() { final String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; final int length = alphabet.length(); Random random = new Random(); String randomChar = String.valueOf(alphabet.charAt(random.nextInt(length))); return randomChar; } }