Java Random Number generateRandomNumber(int length)

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

Description

generate Random Number

License

Open Source License

Declaration

public static String generateRandomNumber(int length) 

Method Source Code

//package com.java2s;

import java.util.*;

public class Main {

    public static String generateRandomNumber(int length) {
        Random random = new Random();
        String val = "";
        for (int i = 0; i < length; i++) {
            val += String.valueOf(random.nextInt(10));
        }/*w w w.ja v a  2s.  com*/
        return val;
    }
}

Related

  1. generateRandomNum(int passNumber)
  2. generateRandomNumb(int randomSize, int range)
  3. generateRandomNumber()
  4. generateRandomnumber(int firstNum, int restNum)
  5. generateRandomNumber(int from, int to)
  6. generateRandomNumber(int min, int max)
  7. generateRandomNumber(int min, int max)
  8. generateRandomNumber(int start, int end)
  9. generateRandomNumberBetween(final int low, final int high)