fork 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.  
  9. class Sort
  10. {
  11. public int[] Implement () {
  12. int [] array = new int[10];
  13. for ( int i = 0 ; i < array.length ; i++ ) {
  14. array[i] = ((int)(Math.random()*100+1));
  15. }
  16. Arrays.sort( array );
  17.  
  18. return array;
  19. }
  20. }
  21.  
  22. class Test
  23. {
  24.  
  25. public static void main(String[] args){
  26. Sort s = new Sort();
  27. int[] array = s.Implement ();
  28. for (int i = 0 ; i < array.length ; i++) {
  29. System.out.println(array[i]);
  30. }
  31. }
  32. }
  33.  
Success #stdin #stdout 0.1s 27856KB
stdin
Standard input is empty
stdout
22
22
38
52
53
56
69
74
86
97