Java Random Number getRandomNumber(int randomCount)

Here you can find the source of getRandomNumber(int randomCount)

Description

get Random Number

License

Open Source License

Declaration

public static String getRandomNumber(int randomCount) 

Method Source Code


//package com.java2s;
import java.util.Random;

public class Main {

    public static String getRandomNumber(int randomCount) {
        Random random = new Random();
        StringBuilder sb = new StringBuilder(randomCount);
        for (int i = 0; i < randomCount; i++)
            sb.append((char) ('0' + random.nextInt(10)));
        return sb.toString();
    }//from w  w  w .j a  va 2 s  . c o  m
}

Related

  1. getRandomNumber(int length)
  2. getRandomNumber(int length)
  3. getRandomNumber(int max, boolean include0)
  4. getRandomNumber(int max, int count)
  5. getRandomNumber(int num)
  6. getRandomNumber(int startNumber, int endNumber)
  7. getRandomNumberBetween(int min, int max)
  8. getRandomNumberFixLength()
  9. getRandomNumberGenerator()