public class H {
public static void main(String args[]) {
int N = 10;
List<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < N; i++) {
list.add(i + 1);
}
int count = N;
int items[] = new int[N];
for (int i = 0; i < N; i++) {
//
int randomInt = new Random().nextInt(count);
items[i] = list.get(randomInt);
list.remove(randomInt);
count--;
System.out.println(items[i]);
}
}
}
java获取Date时间的各种方式为大家分享如下 常用的时间获取方式 public class DateUtils { /** * 获取时间戳 * 输出结果:1438692801766 */ @Test public void getTimeStamp() { Date date = new Date(); long times = date.getTime(); System.out.println(times); //第二种方法: new Date().getTime(); } /** *