Msort error, generic
<p>I am having trouble using the <code>msort</code> method. I don't have any errors, but when I compile, 
I get an error in the following line:</p>

<pre><code>if (((Comparable)arr[midpt-1]).compareTo(arr[midpt]) &lt;= 0)
</code></pre>

<p>The error says:</p>

<blockquote>
  <p>The method CompareTo(Object) belongs to the raw type Comparable. References to generic type comparable should be parametrized.</p>
</blockquote>

<p>Some help?</p>

<pre><code>private static void msort(Object[] arr, Object[] tempArr, int first, int last)
{
    // if the sublist has more than 1 element continue
    if (first + 1 &lt; last)
    {
        // for sublists of size 2 or more, call msort()
        // for the left and right sublists and then
        // merge the sorted sublists using merge()
        int midpt = (last + first) / 2;

        msort(arr, tempArr,first, midpt);
        msort(arr, tempArr, midpt, last);

        // if list is already sorted, just copy from src to
        // dest. this is an optimization that results in faster
        // sorts for nearly ordered lists.
        if (((Comparable)arr[midpt-1]).compareTo(arr[midpt]) &lt;= 0)
            return;

        // the elements in the ranges [first,mid) and [mid,last) are
        // ordered. merge the ordered sublists into
        // an ordered sequence in the range [first,last) using
        // the temporary array
        int indexA, indexB, indexC;

        // set indexA to scan sublist A (index range [first,mid)
        // and indexB to scan sublist B (index range [mid, last)
        indexA = first;
        indexB = midpt;
        indexC = first;

        // while both sublists are not exhausted, compare arr[indexA] and
        // arr[indexB]; copy the smaller to tempArr
        while (indexA &lt; midpt &amp;&amp; indexB &lt; last)
        {
            if (((Comparable)arr[indexA]).compareTo(arr[indexB]) &lt; 0)
            {
                tempArr[indexC] = arr[indexA]; // copy element to tempArr
                indexA++;                      // increment indexA
            }
            else
            {
                tempArr[indexC] = arr[indexB]; // copy element to tempArr
                indexB++;                      // increment indexB
            }
            // increment indexC
            indexC++;
        }

        // copy the tail of the sublist that is not exhausted
        while (indexA &lt; midpt)
        {
            tempArr[indexC] = arr[indexA]; // copy element to tempArr
            indexA++;
            indexC++;
        }

        while (indexB &lt; last)
        {
            tempArr[indexC] = arr[indexB]; // copy element to tempArr
            indexB++;
            indexC++;
        }

        // copy elements from temporary array to original array
        for (int i = first; i &lt; last; i++)
        arr[i] = tempArr[i];
    }
}
</code></pre>
