title: What do I return for binary search of objects?
body: <pre><code>public Song searchSongByName (String name) {
    // ADD YOUR CODE HERE
    int low = 0;
    int high = items.length - 1;
    String foundName = "";
    while ( low &lt;= high ) {
      int mid = (high + low) / 2;
      if ( items[mid].getName().compareTo(name) == 0) {
        foundName+= name;;
      } else {
  
        if ( items[mid].getName().compareTo(name) == -1 ) {
          low = mid;
        } else {
          high = mid;
        }
      }
    }
  </code></pre>
  
  <p>}</p>
  
  <p>This is for a project I'm working on, basically, "items" is an object array of songs and I need to search the array looking for the song given in the parameter. My first idea was to return just the string i made "<code>foundName</code>" but that didn't work out. Then I thought of return -1 (if not found) and 0 (if found) but the return type is Song. So what can I return to let the user know that their song was found? </p>