title: Swapping Min and Max int of an array [Java]
body: <p>I'm supposed to make a static method named swap() that scans an array of integers that takes in the min and max and swaps them. So if max has an index of 0 and min index of 3, index[5] = [3] now and index [3] = [5] now. 
  So the array is created by user inputs:</p>
  
  <pre><code>public static int[] readInputs(int arraySize) {
      System.out.print("What length is the array? ");
      arraySize = console.nextInt();
      int[] intArray = new int[arraySize]; 
      for (int i = 0; i &lt;= intArray.length - 1; i++) {
          System.out.print("Enter an integer: ");
          userInput = console.nextInt();
          intArray[i] = userInput;
      }
      return intArray;
          } //end of readInputs()
  </code></pre>
  
  <p>I am supposed to make another static method that swaps the min and max called swap():</p>
  
  <pre><code>public static int[] swap(int[] intArray){
      for(int index = 0; index &lt; intArray.length; index++){
          if (intArray[index] &gt; max){
              max = intArray[index];
          } 
          if (intArray[index]&lt;min) {
              min = intArray[index];
          }
      }
  } //end of swap()
  </code></pre>
  
  <p>So far, I have it so it finds the min and max, but I'm stuck on how to swap.</p>