Java: Editing Values in a String[]
<p>I am a C++/C# developer but I am new to Java. I am trying to implement setters and getters for an array of strings within a basic class, like so:</p>

<pre><code>private String[] values = new String[35];

public String get_val(int idx) 
{
    return values[idx];
}

public void set_val(int idx, String val) 
{
    values[idx] = val;
}
</code></pre>

<p>When I call the <code>set_val</code> function, it will update the value of the nth string. After running code such as the following:</p>

<pre><code>row.set_val(0, row.get_val(0) + "1");
row.set_val(0, row.get_val(1) + "2");
row.set_val(0, row.get_val(2) + "3");

string foo = row.get_val(0);
</code></pre>

<p>By the time the <code>string foo = row.get_val(0);</code>, the 0th value is back to its original value. Am I missing a concept with arrays and Java? This seems like pretty straight forward code.</p>

<p>Thanks in advance!</p>
