Java Random Int random(int limit)

Here you can find the source of random(int limit)

Description

random

License

Open Source License

Declaration

public static int random(int limit) 

Method Source Code

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

public class Main {

    public static int random(int limit) {
        return ((limit < 1) ? -1 : (int) ((Math.random() * 100000) % (limit)) + 1);
    }// ww  w .  j a va  2  s .co  m
}

Related

  1. randLocation(int min, int max)
  2. Random(int a, boolean Zero)
  3. random(int length)
  4. random(int length)
  5. random(int length, String data)
  6. random(int lo, int hi)
  7. Random(int low, int high)
  8. random(int lowerBound, int upperBound)
  9. random(int maxValue)