title: Having trouble with Binary Search Static method cannot be referenced
body: <p>The problem I face is understanding how to utilize the <code>binary search</code> to search a given <code>array</code>(movies) for a user input title?  I have a feel for the search itself but don't understand how to use the return value to display the title if found or not found.</p>
  
  <p>The chuck of code that follows includes my <code>bubble sort</code> leading into the <code>binary search</code>.  Here are some of the errors message I keep seeing.</p>
  
  <pre><code>C:\Users\goofy bastard\Documents\JAVA&gt;javac CharlieBrownP5.java
  CharlieBrownP5.java:115: error: non-static method binarySearch(Movie[],String) 
  cannot be referenced from a static context   
  binarySearch(movies, key) = x;
  
  CharlieBrownP5.java:115: error: unexpected type
   binarySearch(movies, key) = x;
  
    required: variable
    found:    value
  CharlieBrownP5.java:134: error: cannot find symbol        if(key.comparTo(movies[mid].getTitle()) &gt; 0) {
    symbol:   method comparTo(String)
    location: variable key of type String
  3 errors
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>    public static void displayTotals(Movie[] movies) {
      double totalRevenue = 0;
      int totalMovies = Movie.getTotalMovies();
      for(int i = 0; i &lt; movies.length; i++) {
          totalRevenue += movies[i].calcRevenue();
      }
      System.out.print("The total number of movies is " + totalMovies +
          " and their total revenue is ");
      System.out.printf("%8.3f", totalRevenue);
      System.out.print(" million dollars.\n\n");
  
  }
  
  public static void searchForMovie(Movie[] movies) {
      Scanner input = new Scanner(System.in);
      boolean needNextPass = true;
      String key;
      Movie temp;
  
  
      System.out.print("Enter the Title of the Movie to Search for: ");
      key = input.nextLine();
  
      for(int pass = 1; pass &lt; movies.length &amp;&amp; needNextPass; pass++)
      {
          needNextPass = false;
          for(int x=0; x&lt; movies.length-pass; x++)
          {
              if(movies[x].getTitle().compareTo(movies[x+1].getTitle()) &gt; 0)
              {
                  temp = movies[x];
                  movies[x] =  movies[x+1];
                  movies[x+1] = temp;
  
                  needNextPass = true;
              }
          }
      }
      int x;
      binarySearch(movies, key) = x;
  
      if (movies[x].getTitle() == key){
          System.out.printf(movies[x].toString());
      }
      else{
          System.out.print("There is no match item found for movie " +
              "with the title " + key);
      }
  }
  
  public static void getMenuChoice4() { 
  
  }
  public int binarySearch(Movie[] movies, String key) {
      int low = 0;
      int high = movies.length -1;
      while (high &gt;= low) {
          int mid = (low + high) / 2;
          if(key.comparTo(movies[mid].getTitle()) &gt; 0) {
              high = mid -1;
          }
          else if(key == movies[mid].getTitle()){
              return mid;
          }
          else{
              low = mid + 1;
          }
  
      }   
      return -low - 1;
  </code></pre>
  
  <p>Any help is greatly appreciated ive been at this for hours.
  I am very new to java, this is part of an assignment for my java class.
  Keep it simple please.</p>