title: How do I pass different value to each thread in ExecutorService?
body: <p>Lets say I have an array <code>num_array = [0,1,2,3,4...30]</code></p>
  <p>and I have a multi-threading function like this</p>
  <pre class="lang-java prettyprint-override"><code>static void multiThreadFunct (int[] num_array) {
      ExecutorService executor = Executors.newFixedThreadPool(25);
      try {
          Runnable r = new functToBeMultithreadded(arg1, arg2);
          executor.execute(r);
      } catch (Exception e) {
          System.out.println(&quot;err&quot;);
      }
      executor.shutdown();
  }    
  </code></pre>
  <p>I wanted to know how I can pass <code>num_array[0]</code> to <code>thread 1</code> and <code>num_array[1]</code> to <code>thread 2</code> ... <code>num_array[24]</code> to <code>thread 25</code></p>