public static void main(String []args)
{
char x = 'A';
System.out.println(x++ + ++x); //In Java
Console.WriteLine(x++ + ++x); // In C#
}
In the sample program above I was expecting the output to be 133 .Here is how I evaluated . Since both post and pre increments take precedence over '+' ,it will get evaluated first
Step 1: System.out.println(66 + 67)
Step 2: System.out.println(133)
When will the x become 66 in the post increment operation . Is it in the next line that the value becomes 66 , I am a bit confused in this regard .