int x = 0;
System.out.print(++x==x++);
@geekstomach24 The left operand uses pre-increment (++x) before equals (==) operation. It means the x has value 1 before queals operation. It looks like 1==1. That's why correct answer is the true. The post-increment (x++) will be executed when the entire line is executed System.out.print(++x==x++);. After line System.out.print(++x==x++); the variable x will have value 2.
2023 Jun 5, 9:09:54 AM
Login in to like
Login in to comment