Created
May 24, 2017 16:15
-
-
Save charlesreid1/a5051946cf1f21bac964b7e1f87ae110 to your computer and use it in GitHub Desktop.
PassByRef
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
public class PassByRef { | |
public static void main(String[] args) { | |
int[] array = new int[3]; | |
array[0] = 100; | |
modifyArray(array); | |
System.out.println( Arrays.toString(array) ); | |
} | |
public static void modifyArray(int[] array) { | |
array[0] = 5; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment