Multiple expressions in for loops

From CodeCodex

Revision as of 10:08, 17 August 2009 by Techmind (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Implementations

Java

You do it "à la C". <highlightsyntax language="java122"> public class MultipleFor{

 public static void main (String [] args){
   for (int i=0, j=0; i < 10; i++, j--)
     System.out.println ("i = " + i + " j= " + j);
   }

} </highlightsyntax>