Java tutorial
//package com.java2s; import java.util.Random; public class Main { private static Random r = new Random(); private static int count = 0; public static int randomNumber(int num) { if (count++ > 8) { r = new Random(); } return r.nextInt(num); } }