Here you can find the source of createRandomNumbers(int length)
public static String createRandomNumbers(int length)
//package com.java2s; //License from project: Open Source License import java.util.concurrent.ThreadLocalRandom; public class Main { public static String createRandomNumbers(int length) { String numbers = ""; for (int i = 0; i < length; ++i) { int randomNumber = ThreadLocalRandom.current().nextInt(0, 9); numbers += Integer.toString(randomNumber); }//w w w. j ava 2 s. c o m return numbers; } }