title: How can I set instance variables in classes that update constantly depending on the value of other instance variables?
body: <p>I want to set an instance variable that relies on another.</p>
  
  <p>I tried to define my new instance variable refering to another. For example:</p>
  
  <pre><code>public class numbers{
      int value;
      int triple=3*value;
      .
      .
      .
  }
  </code></pre>
  
  <p>I expected that whenever I updated the independent variable (in the example it would be <code>value</code>) through class methods, the variable <code>triple</code> would update along with the new value of <code>value</code>, but when I run the debugger the dependent variable stays at its default value.</p>