Skip to content

Instantly share code, notes, and snippets.

@mattbenic
Created December 31, 2010 14:11
Show Gist options
  • Select an option

  • Save mattbenic/761035 to your computer and use it in GitHub Desktop.

Select an option

Save mattbenic/761035 to your computer and use it in GitHub Desktop.
Testing evaluation order in Java
int val = 0;
int[] arr = {++val, ++val, ++val};
System.out.println("arr: ["+arr[0]+", "+arr[1]+", "+arr[2]+"]");
val = 0;
evaluationTest(++val, ++val, ++val);
void evaluationTest(int val1, int val2, int val3) {
System.out.println("val1: "+val1+", val2: "+val2+", val3: "+val3);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment