fork(7) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main(String[] args) {
  11. int[] array = new int[10];
  12. Random gerador=new Random();
  13. for(int i=0;i<10;i++){
  14. array[i]=gerador.nextInt(25);
  15. }
  16. System.out.println("Antes");
  17. for(int i: array){
  18. System.out.println(i);
  19. }
  20. Arrays.sort(array);
  21. System.out.println("Depois");
  22. for(int i: array)
  23. System.out.println(i);
  24. }
  25. }
Success #stdin #stdout 0.08s 380224KB
stdin
Standard input is empty
stdout
Antes
10
6
15
3
7
16
15
21
10
7
Depois
3
6
7
7
10
10
15
15
16
21