java - for loop with two variable conditons -
i got question in exam today loop 2 variable(question below ) why output of code has 1 line when giving 2 system.out.println statements.
public class loop {
public static void main(string[] args) { int i; int j; (i = 0 , j = 0 ;j < 0 ; ++j , ++i ){ system.out.println( + " " + j); } system.out.println( + " "+ j); }
}
output:
0 0
any explanation loop 2 variables appreciated.
i starts off @ 0. condition requires j < 0. loop never entered.
Comments
Post a Comment