org.springframework.beans.BeanUtils.copyProperties(source, target,new String[]{'userId', 'modifyBy', 'modifyAt'})StringBuffer sb = new StringBuffer(); String str = '0123456789'; Random r = new Random(); for(int i=0;i int num = r.nextInt(str.length()); sb.append(str.charAt(num)); str = str.replace((str.charAt(num)+''), ''); } return sb.toString();
对象属性选择性拷贝 JAVA生成密码随机数
最新推荐文章于 2024-04-08 14:50:19 发布