Created
May 24, 2017 16:15
-
-
Save charlesreid1/2344fdbd0db2bb7c96f3065cbed87f1b 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