Java Random Number getRandNum(int num)

Here you can find the source of getRandNum(int num)

Description

get Rand Num

License

Apache License

Declaration

public static String getRandNum(int num) 

Method Source Code


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

import java.util.Random;

public class Main {
    public static String getRandNum(int num) {
        String randnum = "";
        for (int i = 0; i < num; i++) {
            Random rand = new Random();
            randnum += rand.nextInt(10);
        }/*from ww w . ja va 2  s  .c om*/

        return randnum;
    }
}

Related

  1. getNumString(int length)
  2. getPhoneNumber()
  3. getPositiveNumber(int maximum)
  4. getRandNum(int charCount)
  5. getRandNum(int num)
  6. getRandNumber(int maxNumber)
  7. getRandomDouble(double max, String decimalFormat)
  8. getRandomNum()
  9. getRandomNum()