class Main {
public static void main(String[] args) {
// a primitive assignment copies the value
int a = 5;
int b = a;
b++;
System.out.println(a + " " + b);
// an array is a reference: both names point at one object
int[] x = {1, 2, 3};
int[] y = x;
y[0] = 99;
System.out.println(x[0]);
}
}primitives copy; objects are shared