I know that when used alone both prefix postfix work the same way but in expressions it behaves differently when combined.:confused:
Code Java:
int a=1,b=3,c=4,d=0; d=a-(b++)*(c++)
please explain its working
Printable View
I know that when used alone both prefix postfix work the same way but in expressions it behaves differently when combined.:confused:
Code Java:
int a=1,b=3,c=4,d=0; d=a-(b++)*(c++)
please explain its working
The results of a postfix operation are the original value, where the prefix results are that of the new value.
Code Java:
int a = 3; int b = a++; // increment a after setting b=a int c = ++a; // increment a then set c=a