title: Can classes in java that implement runnable have methods other than run()?
body: <p>I'm trying to implement a simple class like this:</p>
  
  <pre><code>public static void main(String args[])
  {
      try
      {
          myClass test = new Thread(new myClass(stuff));
          test.start();
          test.join();
      }
      catch (Throwable t) { }
  }
  </code></pre>
  
  <p>When I try to include a print() method in myClass and use it, I get a "cannot find symbol" in class java.lang.Thread. I don't really have to make this a thread, but I would like to, just to test it. Will I have to change it if I want my print() method to work?</p>
  
  <p>EDIT: I am sorry, I just realized I can call print() inside the run() function lol. Why can't I call it outside though? That doesn't make sense to me. If I add synchronized or something can I call the function outside of run/the class?</p>
  
  <p>EDIT2: Sorry I miswrote the names here.</p>
  
  <p>EDIT3: I'm currently doing this:</p>
  
  <pre><code>Thread test = new Thread(new myClass(stuff));
  teste.start();
  teste.join();
  </code></pre>
  
  <p>If I use new Runner, it seems I can't use start() and join(). Is there a way to go about that?</p>
  
  <p>EDIT4: Okay, let's try one more time please:
  I have myEnvironment, which is a class and I have myAgent, which is another class. myAgent is the thread. myAgent requires a myEnvironment, so I was passing it as a parameter to the constructor. However, I couldn't do this by extending Thread, because constructor (myEnvironment) wasn't found. Do I have to set myEnvironment via another function or can I pass it using the constructor?</p>