Here you can find the source of randInt(int low, int high)
public static int randInt(int low, int high)
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { private static final Random rand = new Random(); public static int randInt(int low, int high) { if (low > high) { throw new IllegalArgumentException(); }//w w w . j a v a2 s . co m return rand.nextInt(high - low + 1) + low; } public static int randInt() { return randInt(-4, 4); } }