Java Random Int randInt(int l)

Here you can find the source of randInt(int l)

Description

rand Int

License

Open Source License

Declaration

public static int randInt(int l) 

Method Source Code


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

import java.util.Random;

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

    public static double randInt(int min, int max) {
        return (min + (Math.random() * (max - min + 1)));
    }/* w  ww.java  2  s.c  o m*/

    public static int randInt(int l) {
        return random.nextInt(l);
    }

    public static int randInt() {
        return random.nextInt();
    }
}

Related

  1. rand(int size)
  2. randBetween(int min, int max)
  3. randInRangeInc(int min, int max)
  4. randInt()
  5. randInt()
  6. randInt(int low, int high)
  7. randint(int max)
  8. randInt(int max)
  9. randInt(int min, int max)