All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jladder.lang.R Maven / Gradle / Ivy

There is a newer version: 5.0.44
Show newest version
package com.jladder.lang;

import java.util.concurrent.ThreadLocalRandom;

/***
 * 随机数据操作类
 */
public class R {

    /// 
    /// 取随机数
    /// 
    /// 
    /// 
    /// 
    public static int random(int min, int max)
    {
        return ThreadLocalRandom.current().nextInt(min, max);
    }

    /// 
    /// 取随机数
    /// 
    /// 长度
    /// 
    public static String random(int length)
    {
        StringBuilder sb=new StringBuilder();
        for (int i = 0; i < length; i++)
        {

            sb.append(random(0,9) + "");
        }
        return sb.toString();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy