What is the result of the following code compilation and execution?

public class Main{
    final int x = 1;

    public static void main(String [] str) {
        int x = 2;                            //1
        for (x = 3 ; x < 5 ; x++);            //2
        System.out.println("x=" + x);

    }    
}

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback