title: How to make the user input in descending order?
body: <p>I want the user input in descending order. Output in ascending order is correct but in descending order its not working.</p>
  
  <pre><code> public static void main(String[] argu){
  
      int[] i = new int[10];
      Scanner sc = new Scanner(System.in);
      for (int j = 0; j&lt;=9  ; j++) {
  
          i[j] = Integer.parseInt(sc.nextLine());
  
      }
      Arrays.sort(i);
      System.out.println(Arrays.toString(i));         
      Comparator comparator = Collections.reverseOrder();
  
      Arrays.sort(i,Collections.reverseOrder());
      System.out.println(Arrays.toString(i));
  </code></pre>