Why is a return value of a method need not need be used sometimes?
<p>I stumbled upon this problem, and could'nt seem to find a satisfactory answer to it. Consider the following line, in Java:</p>

<p><code>ListBox.getValue(ListBox.getSelectedIndex())</code></p>

<p>the <code>getValue()</code> method returns a String, but I haven't written it as</p>

<p><code>String foo = ListBox.getValue(ListBox.getSelectedIndex())</code></p>

<p>where the returned value is saved.</p>

<p>Why does writing the statement as in the first case does not cause a warning, or even an error?</p>
