读书人

关于java的一些公共步骤总结(不断更新

发布时间: 2012-11-01 11:11:31 作者: rapoo

关于java的一些公共方法总结(不断更新)

工作总结,不说多,直接上代码

public class UtilComAction {/** * 生成随机数  */public static String generateRandMixed(int n)throws Exception{Random random = new Random();String[] randChars = {"0","1","2","3","4","5","6","7","8","9","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"};    String result = "";    for(int i = 0; i < n ; i ++) {    int id = Math.abs(random.nextInt() % 35);    result += randChars[id];    }    return result;}}
?

读书人网 >软件架构设计

热点推荐