title: Is there any way to implement compareTo method which would compare any supplied argument?
body: <p>The compiler says " cannot find symbol: method compareTo(java.lang.Object) ". Could you please advice where is the mistake here?</p>
  
  <p>Here is the part of the code:</p>
  
  <pre><code>public class OBTComparable&lt;ObjectType&gt; implements Comparable&lt;OBTComparable&gt;
  {
      public OTBComparable leftNode = null;
      public OBTComparable mainNode = null;
      public OBTComparable rightNode = null;
      public ObjectType object = null;
  
      public OBTComparable(ObjectType requiredObject)
      {
          object = requiredObject;
      }
  
      @Override
      public int compareTo(OBTComparable other)
      {
          if(object.compareTo(other.object) == 0)
              return 0;
          else 
              if (object.compareTo(other.object) &gt; 0)
                  return 1;
              else return -1;
      }
  }
  </code></pre>