Here you can find the source of randomShort()
public static short randomShort()
//package com.java2s; //License from project: Creative Commons License public class Main { private static long seed = System.nanoTime(), rand = 0; /**/* w w w. ja v a 2 s .c o m*/ * Generates a random word, manipulating an internal seed which is initially set to * the system time. * * @return a random word */ public static short randomShort() { if (rand == 0) { seed ^= seed << 21; seed ^= seed >>> 35; seed ^= seed << 4; rand = seed; } final short s = (short) (rand & 0xffffL); rand >>>= 16; return s; } }