I am trying to run the below code with x =10
."X is not equal to 10!"
is getting printed. but As per documentation, the else
belongs to the innermost if()?
Also if we replace "1==2"
in the if block with 1==1
then also "X is not equal to 10!"
is getting printed.
I have corrected the code ..
Edit : Got the answer.
if(1==2)
if(x!=10)
System.out.println("X is equal to "+x);
else
System.out.println("X is not equal to 10!");