title: Java equivalent of C++ copy assignment operator
body: <p>I'm trying to understand this operator function written in C++ and convert it to Java.</p>
  
  <pre><code>Class&amp; Class::operator=(const Class&amp; In) {
  
     properties = In.properties;
  
     return *this;
  
  }
  </code></pre>
  
  <p>Does this simply copy instance and properties of a class object? For which I've already written something: </p>
  
  <pre><code>public static Class copy(Class obj) {
      //returns new instance of Class individual
      Class copy =  new Class(obj.row_num, obj.col_num, obj.input_length, obj.output_length, obj.max_arity, obj.function_length, obj.levels_back);
      copy.genes = obj.genes.clone();
      return copy;
  }
  </code></pre>
  
  <p>Am I on the correct track? Many thanks for your help.</p>