Last active
August 6, 2024 07:10
-
-
Save sunmeat/436ac56f50647879ee8b to your computer and use it in GitHub Desktop.
reference copy
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
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