How to reverse a sort algorithm in Java

public class Sort {

  public static void main(String[] args) {


    //fill the array with random numbers
    int[] unsorted = new int[100];
    for(int i = 0; i < 100; i++) {
      unsorted[i] = (int) (Math.random() * 100);
    }

    System.out.println("Here are the unsorted numbers:");
    for(int i = 0; i < 100; i++) {
      System.out.print(unsorted[i] + " ");
    }
    System.out.println();

    int[] sorted = new int[100];
    for(int i = 0; i < 100; i++) {
      int hi = -1;
      int hiIndex = -1;
      for(int j = 0; j < 100; j++) {
        if(unsorted[j] > hi) {
          hi = unsorted[j];
          hiIndex = j;
        }
      }
      sorted[i] = hi;
      unsorted[hiIndex] = -1;
    }
    System.out.println("Here are the sorted numbers: ");
    for(int i = 0; i < 100; i++) {
      System.out.print(sorted[i] + " ");
    }
    System.out.println();
  }
}

So this is in descending order but I want to reverse it.
I tried changing the if(unsorted[j] > hi) {
to a if(unsorted[j] < hi) {
[edit:changed greater than to less than, both were same]

Okay, you want the numbers to be in ascending order. So for descending, you assume that compared number would be -1 and all other number must be grater than this -1, now instead of -1 use the maximum value a number could be. Assign Integer.MAX_VALUE where you were assigning -1. So change your code like this:

 int[] sorted = new int[100];
    for(int i = 0; i < 100; i++) {
      int hi = Integer.MAX_VALUE;   
      int hiIndex = i;
      for(int j = 0; j < 100; j++) {
        if(unsorted[j] < hi) {
          hi = unsorted[j];
          hiIndex = j;
        }
      }
      sorted[i] = hi;
      unsorted[hiIndex] = Integer.MAX_VALUE;