A comma separates the variables
They must be of the same type.
Variables declared in the for statement are all local to the for loop
public class MainClass{
public static void main(String[] argv){
for (int i = 0,j = 0; (i<10) && (j<10); i++, j++) {
System.out.println("i is " + i + " j is " +j);
}
System.out.println();
}
}
|