Here you can find the source of rand(int size)
public static int rand(int size)
//package com.java2s; //License from project: Open Source License public class Main { public static int rand(int size) { return (int) (size * Math.random()); }/*from w ww. j av a2s. c om*/ }