Created
December 31, 2010 14:11
-
-
Save mattbenic/761035 to your computer and use it in GitHub Desktop.
Testing evaluation order in Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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