title: Are Java arrays in a static method thread safe?
body: <pre><code>   public static int rank(int key, int[] a) {
          int lo = 0;
          int hi = a.length - 1;
          while (lo &lt;= hi) {
              // Key is in a[lo..hi] or not present.
              int mid = lo + (hi - lo) / 2;
              if      (key &lt; a[mid]) hi = mid - 1;
              else if (key &gt; a[mid]) lo = mid + 1;
              else return mid;
          }
          return -1;
      }
  </code></pre>
  
  <p>The above static method does binary search. Is it thread safe? I know that local variables are thread safe but "a" here is an array, so that means it's an object in Java, right? Is that a problem?
  The array is just being read, not modified in any way, so I'm assuming this method is thread-safe. But I want to make sure I understand why.</p>
  
  <p>Thanks! </p>