首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

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

2012-11-01 
关于java的一些公共方法总结(不断更新)工作总结,不说多,直接上代码public class UtilComAction {/** * 生

关于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;}}
?

热点排行