Java Random Number genRandomNumber(int digitNumber)

Here you can find the source of genRandomNumber(int digitNumber)

Description

gen Random Number

License

Apache License

Declaration

public static String genRandomNumber(int digitNumber) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Random;

public class Main {
    public static String genRandomNumber(int digitNumber) {
        StringBuilder num = new StringBuilder();
        Random random = new Random();
        for (int i = 0; i < digitNumber; i++) {
            num.append(random.nextInt(10));
        }/*w  ww .ja va  2  s  . com*/
        return num.toString();
    }
}

Related

  1. generateRandomNumericString(int maxLength)
  2. generateSaltNumber()
  3. genRandomNum(int pwd_len)
  4. genRandomNumber()
  5. genRandomNumber(int begin, int end)
  6. genRandomNumber(int minNumber, int maxNumber, int digits)
  7. genRandomNumberString(int numberCount)
  8. genRandomNumList(int num, int count)
  9. getChance(Number number)