title: Find difference in temperature between consecutive days
body: <p>So I inputted this piece of code in my class, it is a method for finding the largest difference in temperature between two consecutive days. There are ten days. I made an array with ten indexes, and I made this up:</p>
  
  <pre><code>import java.util.Arrays;
  import java.util.Collections;
  
  public class Forecast
  {
     int [] temps;
     int WEEK;
     int Under32 = 0;
     int[] blazing;
  
     public Forecast( int y, int[] x )
     {
        WEEK = y;
  
        temps = new int[x.length];
  
        //instantiate array with same length as parameter
        for ( int i = 0; i &lt;= temps.length-1; i++ )
        {
           temps[i] = x[i];
        }
        Arrays.sort(temps);
     }
  
     public void setWeek( int u )
     {
        WEEK = u;
     }
  
     public int getWeek()
     {
        return WEEK;
     }
  
     public void setArray( int[] newTemps )
     {
        temps = newTemps;
     }
  
     //returns an array of temps
     public int[] getTemps()
     {
        int[] w = new int[temps.length];
        for(int i = 0; i &lt; temps.length; i++)
        {
           temps[i] = w[i];
        }
        return w;
     }
  
     public int getUnderFreeze()
     {
        int FROZEN = 0;
        for( int i = 0; i &lt; temps.length; i++ )
        {
           if( temps[i] &lt; 32 )
           {  
              FROZEN += 1;
  
           }
        }
        return FROZEN;
     }
  
     public int[] above100Degrees()
     {
      int newArrayLength=0;
      for( int i = 0; i &lt; temps.length; i++ )
      {
          if( temps[i] &gt; 100 )
          {
              newArrayLength++;
          }
      }
  
      int[] blazing = new int[newArrayLength];
      int positionInNewArray = 0;
      for( int i = 0; i &lt; temps.length; i++ )
      {
          if( temps[i] &gt; 100 )
          {
              blazing[positionInNewArray] = temps[i];
              positionInNewArray++;
          }
      }
      return blazing;
    }   
  
     public int[] Assorted()
     {
        Arrays.sort(temps);
        return temps;
     }
  
     //return an array in descending order, using set algorithm
      public int[] descendSort()
      {
         int[] tempArray = new int[temps.length];
  
         for (int i = temps.length-1; i &lt;= 0; --i)  
         {
           for (int j = 0; j &lt; temps.length-1; ++i){
              tempArray[j] = temps[i];
         }
      }
      return tempArray;
      }         
  
      //method returning the largest change between two consecutive days
      public int NetChange()
      {
        int biggestNet = Math.abs(temps[0] - temps[1]);
        for( int i = 0; i &lt; temps.length - 1; i++ )
        {
           if( Math.abs((temps[i] - temps[i+1])) &gt; biggestNet )
           {
              biggestNet = Math.abs(temps[i] - temps[i+1]);
           }
        }
        return biggestNet;
       } 
  
      public String toString()
      {
        String returnString = "The temperature forecast of week " + WEEK + " is logged in as: ";
        for( int i = 0; i &lt; temps.length; i++ )
        {
            returnString += "\t" + temps[i] + "\t";
        }
        returnString += "\n" + "The number of temperatures below freezing is " + getUnderFreeze() + "." + "\n" + 
                               "The largest difference this week was a net change of " + NetChange() + "." + "\n" + 
                               "The temperature above 100 degrees is: " ; 
  
        int[] blazing = above100Degrees();                       
        for( int i = 0; i &lt; blazing.length; i++ )
        {
           returnString += "\t" + blazing[i] ;
        }
        return returnString;
      }
  
      public boolean equals(Object c)
      {
        if( !(c instanceof Forecast))
           return false;
        else
        {
           Forecast objTemp = (Forecast) c;
  
           if( temps.length != objTemp.temps.length )
              return false;
        }
        return true;
       }
  </code></pre>
  
  <p>}</p>
  
  <p>My object array that is in the client class is this:</p>
  
  <pre><code>int[] temps1 = new int[]{45, 76, 12, 102, 107, 65, 43, 67, 81, 14};
  </code></pre>
  
  <p>My output is this:</p>
  
  <pre><code>The largest difference this week was a net change of -2.
  </code></pre>
  
  <p>This output is severely wrong, what did I do incorrectly????</p>