title: How to access a Runnable object by Thread?
body: <p>Possible duplicate: <a href="https://stackoverflow.com/questions/2300433/need-help-returning-object-in-thread-run-method">need-help-returning-object-in-thread-run-method</a> </p>
  
  <p>Hello. I have a class implementing runnable and I have a List, storing Threads instantiated with different objects of that class. How can I access properties of underlying objects given the thread object running them? Here is an example:</p>
  
  <pre><code>public class SO {
      public static class TestRunnable implements Runnable {
          public String foo = "hello";
  
          public void run() {
              foo = "world";
          }
      }
  
      public static void main(String[] args) {
          Thread t = new Thread(new TestRunnable());
          t.start();
          //How can I get the value of `foo` here?
      }
  }
  </code></pre>