public class selectionSort{
    private int[] array;
    private boolean defaultFlag = false; // provide default value to the inSort method
    public selectionSort(int[] array){
        this.array = array;  // constructor
    }
    public void seSort(boolean reverse){
    // use a boolean variable named reverse to control whether to reverse sort or not
        int minIndex;
        for(int i=0; i<this.array.length-1; i++){
            minIndex = i;
            for(int j=i+1; j<this.array.length; j++){
                if(!reverse){    // use the boolean here
                    if(this.array[j]<this.array[minIndex]) {
                        minIndex = j;
                    }
                }
                else {
                    if(this.array[j]>this.array[minIndex]){
                        minIndex = j;
                    }
                }
            }
            // swap the values
            int temp = this.array[i];
            this.array[i] = this.array[minIndex];
            this.array[minIndex] = temp;

        }
    }
    public void seSort(){
        // overload the inSort() method, setting the 'default' sort order to asc
        seSort(defaultFlag);
    }
    
    public void seSortReverse(){
        int minIndex;
        for(int i=0; i<this.array.length-1; i++){
            minIndex = i;
            for(int j=i+1;j<this.array.length; j++){
                if(this.array[j] > this.array[minIndex]){
                    minIndex = j;
                }
            }
            // swap the values
            int temp = this.array[i];
            this.array[i] = this.array[minIndex];
            this.array[minIndex] = temp;
        }
    }
    // public static void swap(int[] array, int index1, int index2){
    //     int temp = array[index1];
    //     array[index1] = array[index2];
    //     array[index2] = temp;
    // }
    public static void main(String[] args){
        int[] numbers = {8, 3, 7, 10, 9, 10, 20, 1};
        // create the object
        selectionSort x = new selectionSort(numbers);
        // print out the original object/ array
        for (int item: numbers) {
            System.out.print(item+", ");
        }
        System.out.print("\n");
        boolean reverse = false;
        // call the seSort() method on the object
        x.seSort();   // default sort
        for (int i:x.array){
            System.out.print(i+", ");
        }
        System.out.print("\n");
        reverse = true;
        // call the seSort() with a reverse value
        x.seSort(true);
        for (int i: x.array){
            System.out.print(i+", ");
        }
        System.out.print("\n");
        reverse = false;
        // test method overloading
        x.seSort(false);
        for (int i: x.array){
            System.out.print(i+", ");
        }
        
    }
}

@@ -50,23 +50,38 @@
 ay;%0A    
-private
+// public static final
  boolean
@@ -1178,16 +1178,19 @@
 %0A       
+ //
  seSort(
@@ -1203,16 +1203,39 @@
 tFlag);%0A
+        seSort(false);%0A
     %7D%0A  
@@ -1236,24 +1236,27 @@
   %7D%0A    %0A   
+ //
  public void
@@ -1272,24 +1272,27 @@
 verse()%7B%0A   
+ //
      int min
@@ -1293,32 +1293,35 @@
 nt minIndex;%0A   
+ //
      for(int i=0
@@ -1346,32 +1346,35 @@
 gth-1; i++)%7B%0A   
+ //
          minInde
@@ -1375,32 +1375,35 @@
 inIndex = i;%0A   
+ //
          for(int
@@ -1431,32 +1431,35 @@
 ength; j++)%7B%0A   
+ //
              if(
@@ -1492,32 +1492,35 @@
 %5BminIndex%5D)%7B%0A   
+ //
                 
@@ -1529,32 +1529,35 @@
 inIndex = j;%0A   
+ //
              %7D%0A 
@@ -1550,32 +1550,35 @@
            %7D%0A   
+ //
          %7D%0A     
@@ -1567,32 +1567,35 @@
 //         %7D%0A   
+ //
          // swap
@@ -1601,32 +1601,35 @@
 p the values%0A   
+ //
          int tem
@@ -1642,32 +1642,35 @@
 is.array%5Bi%5D;%0A   
+ //
          this.ar
@@ -1695,32 +1695,35 @@
 y%5BminIndex%5D;%0A   
+ //
          this.ar
@@ -1743,24 +1743,27 @@
  = temp;%0A   
+ //
      %7D%0A    %7D
@@ -1756,24 +1756,27 @@
 //     %7D%0A   
+ //
  %7D%0A    // pu
@@ -2622,19 +2622,22 @@
 .seSort(
-tru
+revers
 e);%0A    
@@ -2815,27 +2815,29 @@
    x.seSort(
-fal
+rever
 se);%0A       
@@ -2899,32 +2899,64 @@
 , %22);%0A        %7D%0A
+        System.out.print(%22%5Cn%22);%0A
         %0A    %7D%0A%7D

comment out the seSortReverse method; use boolean value false directly for the default seSort method instead of creating a public static final variable