Java for loop running sequence, condition part or initialization part?

Question

What is the output of the following code:

public class Main {  
  public static void main(String args[]) {  
    int i = 0;/*from  w w w  .j  a  v a2  s . c  o  m*/
    for(System.out.println("Init Value is: " + i); 
        ++i>0; 
        i--, System.out.println("Iteration Value is: " + i)) {  
      System.out.println("Value is: " + i);
      break;
     } 
 
  }  
} 


Init Value is: 0
Value is: 1



PreviousNext

Related