import java.util.ArrayList;
import java.util.List;
class Main {
static void replace(List<Integer> items) {
// pointing the local name at a new list breaks the link
items = new ArrayList<>(List.of(9, 9, 9));
}
public static void main(String[] args) {
var nums = new ArrayList<>(List.of(1, 2, 3));
replace(nums);
// the caller's list is untouched
System.out.println(nums);
}
}a new binding does not reach the caller