title: Java - recursive binary search help
body: <p>The following code is how I'm trying to create a recursive binary method..</p>
  
  <pre><code>public static int binarySearch(Comparable[] objArray, Comparable item)
  {
  
      int lower=0;
      int upper=objArray.length -1;
      int i = -1;
      int compareResult;
      boolean found = false;
      while ((lower&lt;=upper) &amp;&amp; (!found))
      {
          i=(lower+upper)/2;
          compareResult=item.compareTo(objArray[i]);
          if(compareResult&lt;0)
          {
              upper=i-1;
          }
          else
              if (compareResult&gt;0)
              {
                  lower=i+1;
              }
              else
              {
                  found=true;
              }
  
  
      }
      return compareResult;
  
  
  
  }
  </code></pre>
  
  <p>I feel as thought I'm not doing this correctly...any suggestions?</p>
  
  <p>-D</p>