title: Error while trying to get max value in array
body: <p>So I was trying to return the max value within an type "T" array list and got an error while using compareTo. This is the full code. </p>
  
  <pre><code>package myUtil;
  
  public class SimpleListAry&lt;T extends java.lang.Comparable&lt;T&gt;&gt; extends java.lang.Object implements SimpleList&lt;T&gt; {
      private T[] myList;
      private int size;
      public SimpleListAry(){
         myList = (T[])new Comparable[10];
      }
      public SimpleListAry(int capacity){
          if (capacity &lt;= 0){
              throw new IllegalArgumentException();
          }
          myList = (T[]) new Object [capacity];
      }
  
      @Override
      public int size() {
          size = myList.length;
          return size;
      }
      @Override
      public T get(int i) {
          return myList[i];
      }
  
      @Override
      public T set(int i, T item) {
          return myList[i] = item;
      }
  
      @Override
      public int indexOf(Object item) {
          for (int i = 0; i &lt; size; i++){
              if (get(i).equals(item)){
                  return i;
              }
          }
        return -1;
      }
  
      @Override
      public void add(int at, T item) {
          if (at &lt; 0 || at &gt; size)
              throw new ArrayIndexOutOfBoundsException(at);
          for (int i = size; i &gt; at; i--){
              myList[i] = myList [i-1];
          }
  //        myList[at] = item;
          size++;
      }
  
  
      @Override
      public T remove(int at) {
          if (at &lt; 0 || at &gt;= size)
              throw new ArrayIndexOutOfBoundsException(at);
          T item = myList[at];
          for (int i = at; i&lt;size-1; i++)
              myList[i] = myList[i+1];
          size--;
          return item;
      }
  
      @Override
      public T max() {
          T max = myList[0];
          for (int i = 1; i &lt; myList.length; i++){
              if(myList[i].compareTo(max) == 1)
                  max = myList[i];
          }
          return max;
      }
  
      @Override
      public T min() {
          T min = myList[0];
          for (int i = 1; i &lt; size -1; i++){
              if (myList[i].compareTo(min) == -1)
                  min = myList[i];
          }
          return min;
      }
  
  
  }
  </code></pre>
  
  <p>and the error is at Public T max():</p>
  
  <pre><code>public T max() {
  T max = myList[0];
  for (int i = 1; i &lt; myList.length; i++){
      if(myList[i].compareTo(max) == 1)
          max = myList[i];
  }
  return max;
  </code></pre>
  
  <p>}</p>
  
  <p>I also tried using ">" to compare them but that was not working either. It may be because of the data type but there's no error in the IDE only when I attempt to run it and it points directly to this line in T max(){</p>
  
  <pre><code>if(myList[i].compareTo(max) == 1)
  </code></pre>