How do I copy a replace an existing string with a character array in Java
<p>I have a String which is already initialized. Now I want to replace the contents with a character array. I would like to know if doing the following:</p>

<pre><code>stringObj = new String(charArr);
</code></pre>

<p>is fine?</p>

<p>Would this lead to any memory leaks?</p>

<p>Sorry if this question has been answered already, I could not find the answer to this at all. </p>
