title: Copying object fields
body: <p>What is the best way of copying classes when I need to have two independent variables?
  I have simple class:</p>
  
  <pre><code>public class MyClass 
  {
  boolean a = false;
  String b= "not empty";
  }
  </code></pre>
  
  <p>do I need make some method like :</p>
  
  <pre><code>assign(MyClass data )
  {
  a= data.a;
  b= data.b;
  }
  </code></pre>
  
  <p>Is there any automatic method to copy (duplicate) objects in java?</p>