title: Java object copy best option?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/869033/how-do-i-copy-an-object-in-java">How do I copy an object in Java?</a>  </p>
  </blockquote>
  
  
  
  <p>I need to copy an object in Java (i.e. copy the object "by value not by reference" so that the new object is not just a reference to the old).  I'm weary of implementing clonable and would prefer to use a copy constructor.  However, the class I need to copy has MANY member variables that need to be copied (over 100) so adding a new constructor to the class just for copying (which is only needed in a 1 part of my application) seems like a poor solution due to its enourmous length.</p>
  
  <p>Is there a better solution?  Should I just use clone()?  Can I create a copy constructor but rather than copying all the fields over 1 by 1 can I do it reflectively?  Thanks.</p>
  
  <p>I basically just need to create a new object that is the same as the old one, but with a few (about 10 out of 100) fields changed (but I still need both objects..so the new one cannot be a reference to the old one).  I am open to any suggestions.</p>