Created
January 13, 2014 08:52
-
-
Save jnizet/8396773 to your computer and use it in GitHub Desktop.
This file contains 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
import java.util.Arrays; | |
public class ArrayTest { | |
public static void main(String[] args) { | |
int[] array = new int[] {1, 2, 3, 4}; | |
foo(array); | |
System.out.println("array in main : " + Arrays.toString(array)); | |
} | |
private static void foo(int[] array) { | |
// ignore the argument, and assign a new value to it | |
array = new int[] {5, 6, 7, 8}; | |
System.out.println("array in foo : " + Arrays.toString(array)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment