Java Random Number getNumber(int length)

Here you can find the source of getNumber(int length)

Description

get Number

License

Open Source License

Declaration

private static String getNumber(int length) 

Method Source Code


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

import java.util.Random;

public class Main {
    public static Random random = new Random();

    private static String getNumber(int length) {
        String sRand = "";
        for (int i = 0; i < length; i++) {
            String rand = String.valueOf(random.nextInt(10));
            sRand += rand;/*w w w  .  j  a  v a2  s. c o m*/
        }
        return sRand;
    }
}

Related

  1. getNumAndWord(int length)
  2. getNumber()
  3. getNumber()
  4. getNumber(int _nX0, int _nX1)
  5. getNumber(int length)
  6. getNumber(int length)
  7. getNumber(int seed)
  8. getNumberClose(int seed)
  9. getNumberedUsername(String fn, String ln)