title: Java - Update Object from another class
body: <p>How can I update an object in class A from a method in class B without using the return?</p>
  
  <p>for example:</p>
  
  <pre><code>public class A {
  //my main class
  
  private javax.swing.JTextField txtField1;
  //a text field (txtField1) is initialized in this class and drawn
  
  }
  
  
  public class B {
  
  public void doSomething(){
  
      //does something and updates the txtField1 in class A
  
  }
  
  }
  </code></pre>
  
  <p>and once again, I do not wish to use <strong>return</strong> since my return is already returning another value from the same method.</p>