title: Objects field changes for unknown reason
body: <p>I am writing a program dealing with subnets.</p>
  
  <p>In simpleIPaddress.class line 315, the object Ted's fullSubnetAddress = "111.111.111.111".</p>
  
  <p>In simpleIPaddress.class line 317, the object Ted's fullSubnetAddress changes for some reason I can not figure out.  It changes to the as textAddress the field variable for the class.  textAddress is generated from the program earlier in the code when the simpleIPaddress address is initially created from user input.</p>
  
  <p>After the first time the for loop is executed, Ted is changed permanently for the rest of the for loop.</p>
  
  <p>In the code I am slowly populating an array.</p>
  
  <pre><code>SubnetItem ted = new SubnetItem(subnetNumber, fullSubnetAddress, fullStartHost,
      fullEndHost, fullBroadcastAddress);
  this.subnetArray = new SubnetItem[totalSubnets];
  
  for (int i = 0; i &lt; subnetArray.length; i++)
  {
  
      this.subnetArray[i] = ted; // line 315
      this.subnetArray[i].setSubnetNumber(i);
      System.out.println(ted.toString()); // line 317
      calculateStartingAddress(i);
  
      System.out.println(ted.toString());
  
      System.out.println(subnetArray[i].toString());
  
  }
  </code></pre>
  
  <p><a href="https://gist.github.com/anonymous/a70a6b3f2bdba48a4678" rel="nofollow">Here is the full code</a> if that is needed.</p>