String randomKey(int sLen) {
String base;
String temp;
int i;
int p;
base = "1234567890";
temp = "";
for (i = 1; i < sLen; i++) {
p = (int) (Math.random() * 10);
temp += base.substring(p, p + 1);
}
return (temp);
}
随即产生数 但具体每句话什么意思?谢谢 简单的说说
String base;
String temp;
int i;
int p;
base = "1234567890";
temp = "";
for (i = 1; i < sLen; i++) {
p = (int) (Math.random() * 10);
temp += base.substring(p, p + 1);
}
return (temp);
}
随即产生数 但具体每句话什么意思?谢谢 简单的说说
解决方案 »
- struts2 if标签。。。纠结中
- 谁给我解释一下这段代码 重点是黑体字部分哦 帮帮我吧
- config.getServletContext().getResource("/WEB-INF/signon-config.xml");是什么意思
- 求救呀!!!!!!
- jsp页面调用htm文件后打开为乱码,怎么解决?
- 关于javamail api 的问题,知道的XDJM帮帮忙啊
- 如何在JSP里防止后退和刷新提交表单?
- jsp page 运行问题
- 快来看看这段程序。是哪里错了?javabean?jsp?只有这些分了,请帮个忙,谢谢!!
- sql.SQLException:not support oracle driver 1.0
- jsf中如何取得当前系统路径
- 关于对象的菜鸟问题
String temp;
int i;
int p;
base = "1234567890";
temp = "";
for (i = 1; i < sLen; i++) { //sLen返回的数字的长度
p = (int) (Math.random() * 10); //随机生成一个0到9之间的数字p
p = 9;
temp += base.substring(p, p + 1); //从base中取p位置上的单个字符,并连接到temp上面
}
return (temp);