fork(1) download
  1. import java.util.*;
  2. import java.util.Collections;
  3.  
  4. class HelloWorld {
  5. public static void main (String[] args) {
  6. ArrayList<Integer> lista = new ArrayList<>();
  7. for (int i = 0; i < 50; i++) {
  8. lista.add(i);
  9. }
  10. seleciona(lista);
  11. for (int i = 0; i < 50; i++) {
  12. System.out.println(lista.get(i));
  13. }
  14. }
  15. public static void seleciona(ArrayList<Integer> arraylist) {
  16. Collections.shuffle(arraylist);
  17. }
  18. }
  19.  
  20. //http://pt.stackoverflow.com/q/183808/101
Success #stdin #stdout 0.05s 4386816KB
stdin
Standard input is empty
stdout
22
3
17
33
40
25
26
42
46
12
37
31
41
1
10
35
19
23
8
21
34
38
14
43
28
48
29
44
49
27
24
30
39
47
18
0
36
45
2
5
11
32
9
16
15
4
7
13
20
6