Java ArrayList problem (involves valueOf())
<p>So I have this function, combinations, which adds to an arraylist all permutations of a string.</p>

<pre><code> public static void combinations(String prefix, String s, ArrayList PermAttr) {
        if (s.length() &gt; 0) {
            PermAttr.add(prefix + s.valueOf(s.charAt(0)));
            combinations(prefix + s.valueOf(s.charAt(0)), s.substring(1), PermAttr);
            combinations(prefix,               s.substring(1), PermAttr);
        }
 }  
</code></pre>

<p>Now, I have this arrayList tryCK which let us say is {"A","B"}.</p>

<p>I have another arrayList CK which is also {"A","B"}, but it was derived from the combinations function above.</p>

<p>When I do tryCK.equals(CK) it returns true.</p>

<p>But when I put it through a another function I have on both tryCK and CK, for tryCK it returns true and CK it returns false, even though they are exactly the same lists.</p>

<p>So, my question is, does using .valueOf(s.charAt()) change some inner type?</p>

<p>This is super hard to explain but I do not want to post the full code.</p>
