/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved. <a>http://www.cqcis.com</a>
 */
package com.crunii.micro.common.utils;

import java.util.concurrent.ThreadLocalRandom;

/**
 * @author 田平 create 2016年4月22日下午3:12:52
 */
public class RandomUtil {
	/**
	 * <pre>获取指定范围内的随机数</pre>
	 *
	 * @param min
	 * @param max
	 * @return
	 */
	public static int getRandom(int min, int max) {
		return ThreadLocalRandom.current().nextInt(min, max + 1);
	}

	public static void main(String[] args) {
		for (int i = 0; i < 10; i++) {
			System.out.println(getRandom(1, 3));
		}
	}
}
