Strings in Java
<p>I have a code:</p>

<pre><code>for(int i=0;i&lt;fList.size();i++){
    String targets="";
    String values="";
    String sql="INSERT INTO "+tableName+"("+targets+") VALUES("+values+")";
    Map&lt;Column, String&gt; attrs=fList.get(i).getAttributes();
    for(int j=0;j&lt;columns.size();j++){
        if(columns.get(j).getName().equalsIgnoreCase("kadnum")){
            targets=targets+"kadnum,";
            System.out.println("targets:"+targets);
            values=values+attrs.get(columns.get(j))+",";
            System.out.println("values:"+values);
        }
        if(columns.get(j).getName().equalsIgnoreCase("support_num")){
            targets=targets+"support_num";
            values=values+attrs.get(columns.get(j))+",";
        }
    }
    System.out.println("sql="+sql);
}
</code></pre>

<p>And get out put:</p>

<pre><code>INSERT INTO parcels () VALUES()
</code></pre>

<p>But if u change <code>System.out.println("sql="+sql);</code> to    <code>System.out.println("targets="+targets);</code> i get : <code>targets=kadnum,</code>
 Why string sql not change?</p>
