Python For Loop Syntax to Java
<pre><code> for j in [c for c in coinValueList if c &lt;= cents]:
</code></pre>

<p>How would you write this for loop out in java?
Is it</p>

<pre><code>for(j=0, j &lt;= cents, j++){
    for(c=0; c&lt;= cents, j++){
</code></pre>

<p>I'm not sure what c and j are supposed to be compared to.
CoinValueList = {1,5,10,25}
cents = 0 -- it's in its own for loop before these two.</p>

<p>if you want to translate very literally in Java</p>

<pre><code>List&lt;Integer&gt; newList = new ArrayList();

for(Integer c : coinValueList) {
    if(c &lt;= cents) {
        newList.append(c);
    }   
}

for(Integer j : newList) {
    # do something
}
</code></pre>

<p>but normally you don't need second <code>for</code> loop</p>

java python for-loop syntax