我试了,是这样做的:
Random rd = new Random();
byte[] temp = new byte[16];
String str = rd.nextBytes(temp);这样只能得到一个10字符的串,并且,前三个字符总是一样的,我这样写的错误在哪里呢?
Random rd = new Random();
byte[] temp = new byte[16];
String str = rd.nextBytes(temp);这样只能得到一个10字符的串,并且,前三个字符总是一样的,我这样写的错误在哪里呢?
解决方案 »
- 求解一段JS代码,多谢
- 如何将为Excel的数据加载到Oracle中?
- 求struts分页代码和中文乱码处理方法
- struts判断使用ACTION里的那个方法简单问题
- JSP的开发工具
- 谁有jakarta-tomcat-4.1.30.exe,200分当场拿走!
- 如些一个简单得不能再简单的applet为什么有的机器可以运行,有的不行,我想知道原因是什么?
- 怎样自动检测用户有没有安装Adobe Reader的插件,并能自动安装它?
- jbuilder8的问题
- 系统提示"Result set type is TYPE_FORWARD_ONLY“ 可是我想知道记录条数
- shkwh(龙威) 请进!!
- mysql?如何启动!!!!!!!!!!
import java.lang.*;class RandomChar {
public static void main(String[] args) {
Random r = new Random();
int i = 0;
int c;
while (i < 8) {
if ( (c=r.nextInt(122)) > 64) {
System.out.print((char)c);
i++;
}
}
}
}