Here you can find the source of RandomCode()
public static String RandomCode()
//package com.java2s; //License from project: Open Source License public class Main { public static String RandomCode() { StringBuffer str = new StringBuffer(); str.append((int) (Math.random() * 9 + 1)); for (int i = 0; i < 5; i++) { str.append((int) (Math.random() * 10)); }// w ww . j av a 2 s . co m return str.toString(); } }