We all know that int++
will increase the variable value by 1, that is to say:
int number = 0;
int temp = number + 1;
number = temp;
This is allowed by the other primitive types too:
double number = 0D;
number++;
So, I was wondering if the code above will be executed as:
double number = 0D;
double temp = number + 1D;
number = temp;
Or:
double number = 0D;
int temp = number + 1;
number = temp;
In the second case, should we prefer double += 1D
instead?