系统自动生成ID(比UUID.radom().tostring()要好看)

public class test1
{
    public static void main(String[] args) {
        char[] para = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9'};
        String result = new String();
        for(int i =0;i<32;i++){
            int c = new Random().nextInt(35);
            result += String.valueOf(para[c]);
        }
        System.out.println(result);
    }
}

 

posted @ 2016-08-19 17:30  小琪子  阅读(382)  评论(0编辑  收藏  举报