Android Random String Create getRandomPwd()

Here you can find the source of getRandomPwd()

Description

get Random Pwd

Declaration

public static String getRandomPwd() 

Method Source Code

//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);
    }
}

Related

  1. getRandomStr(int length)
  2. getRandomString(int length)
  3. randomString(int size)
  4. randomIVString()
  5. getRandomString()
  6. genRandomString(int pLength)
  7. generateRandom()
  8. randomAlphaNumeric(int length)