Here you can find the source of random()
public static String random()
//package com.java2s; import java.util.concurrent.ThreadLocalRandom; public class Main { public static String random() { String str = ""; for (int i = 0; i < 20; i++) { str += String.valueOf((ThreadLocalRandom.current().nextInt(0, 9))); }// www. ja va 2s .co m return str; } }