I have the following code:
boolean[] myArray = new boolean[10];
int a, b;
:
myArray[a * b] = myArray[a * b] ? false: true;
a++;
I am trying to simplify the following to one line:
myArray[a * b] = myArray[a * b] ? false: true;
a++;
Should it be:
myArray[a * b] = myArray[a++ * b] ? false: true;
or
myArray[a++ * b] = myArray[a * b] ? false: true;
I understand a++ means apply a then do the increment. However, my question here is should a++ be at the left side or right side of the assignment operator "=" ? Thanks!