Code example for Random

Methods: nextFloat

0
			return -1; 
		} 
	} 
 
	public static final float random(final float pMin, final float pMax) {
		return pMin + RANDOM.nextFloat() * (pMax - pMin);
	} 
 
	/** 
	 * @param pMin inclusive! 
	 * @param pMax inclusive! 
	 * @return 
	 */ 
	public static final int random(final int pMin, final int pMax) {
		return pMin + RANDOM.nextInt(pMax - pMin + 1);
	} 
 
	public static final boolean isPowerOfTwo(final int n) {
		return ((n != 0) && (n & (n - 1)) == 0);
	} 
Stop searching for code, let great code find you!  Add Codota to your java IDE