title: How do I call variables from a Java class in another Class
body: <p>If I have a class with prepared statements, how do I call them when a user presses a button.</p>
  
  <pre><code>class updateeButtonHandler implements ActionListener
  {
      public void actionPerformed(ActionEvent e)
      {
          name = displayName.getText();
          price = bookPrice.getText();
          Queries update = new Queries();???????????????????
      }
  }
  </code></pre>
  
  <p>Prepared Statement in different class</p>
  
  <pre><code>public int update(String price, String name) throws SQLException {
          ps2.setString(1, name);
          ps2.setString(2, price);
          System.out.print("Update - ");
          return ps2.executeUpdate();
      }
  </code></pre>