...
Here's an example:
Code Block | ||
---|---|---|
| ||
import java.util.Arrays;
static void modifyArray(int[] arr) {
arr[0] = 99;
System.out.println("Array inside method: " + Arrays.toString(arr));
}
public static void main(String[] args) {
int[] myArray = {1, 2, 3};
modifyArray(myArray);
System.out.println("Array outside method: " + Arrays.toString(myArray));
} |
...