Here you can find the source of getRandomPwd()
public static String getRandomPwd()
//package com.java2s; import java.util.Random; public class Main { private static Random rm = new Random(); public static String getRandomPwd() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < 6; i++) { sb.append(getRandomIntNum(9)); }/* w ww .j av a 2 s . c o m*/ return sb.toString(); } private static int getRandomIntNum(int limit) { return rm.nextInt(limit); } }