title: java - passing a double value by reference
body: <p>how can I pass a double value by reference in java?</p>
  
  <p>example:</p>
  
  <pre><code>Double a = 3.0;
  Double b = a;
  System.out.println("a: "+a+" b: "+b);
  a = 5.0;
  System.out.println("a: "+a+" b: "+b);
  </code></pre>
  
  <p>this code prints:</p>
  
  <pre><code>a: 3 b: 3
  a: 5 b: 3
  </code></pre>
  
  <p>and my problem is to get it to print:</p>
  
  <pre><code>a: 3 b: 3
  a: 5 b: 5
  </code></pre>
  
  <p>my goal:
  I'm writing an expert system in jess, in that application a segment would have a double value for it's length, now that double value isn't in a single segment; it's in many other segments, proportionality classes..etc, all of which are referencing to it, waiting it to change so that they could possibly meet some rules.</p>
  
  <p>if I can't get that double to change, I can't have a certain rule fire which contains an object that references to that double value.</p>