Java tutorial
//package com.java2s; import java.util.*; public class Main { /** * Generate array of alphabet * @return String */ public static String generateAlphabet(int length) { String alphabet = "abcdefghijklmnopqrstuvwxyz"; String randomAlphabet = ""; Random random = new Random(); for (int i = 0; i < length; i++) { randomAlphabet = randomAlphabet + alphabet.charAt(random.nextInt(alphabet.length())); } return randomAlphabet; } }