Java tutorial
//package com.java2s; import java.util.Random; public class Main { public static String generateString(int length) { StringBuffer sb = new StringBuffer(); Random random = new Random(); for (int i = 0; i < length; i++) { sb.append(random.nextInt()); } return sb.toString(); } }