title: Is constructor chaining pass by reference in Java, and how does casting affect it?
body: <p>Suppose I have three constructors in a class:</p>
  
  <pre><code>public class MyClass {
      Parent thingA;
      Child thingB;
      boolean someBoolean;
      double someDouble;
      double anotherDouble;
  
      public MyClass(Parent thingA, boolean someBoolean) {
         this(thingA, someBoolean, 0.25);
      }
  
      public MyClass(Child thingB, boolean someBoolean, double anotherDouble) {
         // Casting to prevent recursive constructor call
         this((Parent) thingB, someBoolean, 0.5);
         this.thingB = thingB;
         this.anotherDouble = anotherDouble;
      }
  
      public MyClass(Parent thingA, boolean someBoolean, double someDouble) {
         this.thingA = thingA;
         this.someBoolean = someBoolean;
         this.someDouble = someDouble;
      }  
  }
  </code></pre>
  
  <p>Where <code>Child</code> extends <code>Parent</code>. My question is, when I call another constructor from a constructor in Java via <code>this(...)</code>, am I passing by reference or passing by value? How does casting affect it? If I were to use the second constructor and modify a property of thingB, would that reflect in thingA?</p>
  
  <p>Edit: I have both thingA and thingB fields because sometimes my class will be used without an instance of <code>Child</code>, but when <code>Child</code> is used, I need to take advantage of specific behaviors of <code>Child</code>.</p>