Skip to content

Instantly share code, notes, and snippets.

@sunmeat
Last active August 6, 2024 07:10
Show Gist options
  • Save sunmeat/436ac56f50647879ee8b to your computer and use it in GitHub Desktop.
Save sunmeat/436ac56f50647879ee8b to your computer and use it in GitHub Desktop.
reference copy
package com.alex.methods;
import java.util.Arrays;
public class JavaApplication1 {
static void changeArray(int[] ar) {
ar[0] = 100;
}
public static void main(String[] args) {
int[] ar = {1, 2, 3};
changeArray(ar);
System.out.println(Arrays.toString(ar)); // 100 2 3
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment