Java Random Number getRandomNumericString(int maxlen)

Here you can find the source of getRandomNumericString(int maxlen)

Description

get Random Numeric String

License

Open Source License

Declaration

public static String getRandomNumericString(int maxlen) 

Method Source Code

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

import java.util.Random;

public class Main {
    private static Random R = new Random();

    public static String getRandomNumericString(int maxlen) {
        String str = new String();
        for (int j = 0, n = R.nextInt(maxlen) + 1; j < n; ++j) {
            str += (char) ('0' + R.nextInt(10));
        }/*w  w  w  .j a v a 2 s.com*/
        return str;
    }
}

Related

  1. getRandomNumberGenerator()
  2. getRandomNumberInRange(Random random, int min, int max)
  3. getRandomNumbers(int range, int count, Random rnd)
  4. getRandomNumberString(int length)
  5. getRandomNumer(int length)
  6. getRandomPortNumber()
  7. getRandonNumber(int range)
  8. getrannumber()
  9. getRndNumByLen(int lengthOfNumber)