Java ThreadLocalRandom createRandom(int number)

Here you can find the source of createRandom(int number)

Description

create Random

License

Open Source License

Declaration

public static String createRandom(int number) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.concurrent.ThreadLocalRandom;

public class Main {

    public static String createRandom(int number) {
        long min = (long) Math.pow(10, number - 1) + 1;
        long max = (long) Math.pow(10, number) - 1;
        long result = (long) ThreadLocalRandom.current().nextDouble(min, max);
        return result + "";
    }/*w ww .java 2s  .c  o m*/
}

Related

  1. base62Random()
  2. createNewPin()
  3. createRandomName()
  4. createRandomNumbers(int length)
  5. generateDescription()
  6. generateRandomDoubleVector(int dimension, double bottomLimit, double topLimit)