时间问题,源码没有写出来,放在这里占位,欢迎热心的高手指点
解决方案 »
- java.sql.Statement中执行SQL (sql server 2000)
- 数据输入验证异常处理
- (急急急)java执行linux命令的问题
- 如何将会车换行符、,替换成空格!
- 求lucene全文检索实例,附带源代码!!!!!!!!!!!!!!!!
- Dialog为何不能在JBuilder进行Design面板设计啊
- 怎么写了addWindowListener()还是关不掉窗口啊?
- 我想用JNI传递一个类,遇到了麻烦。
- SCJD该不该考?
- 我的程序里实例变量变成静态变量时,其值才会改变,不是静态变量就不会变,别人写的程序不用变成静态变量也可以,为什么,求解??
- java.util.logging 使用过程中的问题:配置文件logging.properties的使用
- mysql无法使用update方法往数据库中插入汉字,只能插入数字!急救!
import java.util.Random;public class Test {
private Integer[] arrayInteger; public Test() {
arrayInteger = new Integer[49];
for (int i = 0; i < 49; i++)
arrayInteger[i] = i + 1;
} public Test(Integer[] array) {
this.arrayInteger = array;
} public Integer[] shuffle() { Random rand = new Random(System.currentTimeMillis());
Integer[] array = arrayInteger;
for (int i = 0; i < array.length; i++)
array = swap(array, i, rand.nextInt(array.length));
return array; } private Integer[] swap(Integer[] array, int index, int end) {
Integer temp = array[index];
array[index] = array[end];
array[end] = temp;
return array;
} public static void main(String[] args) {
for (int i = 0; i < 6; i++)
System.out.println(new Test().shuffle()[i]);
}
}