Immutable array in Java

Not with primitive arrays. You’ll need to use a List or some other data structure:

List<Integer> items = Collections.unmodifiableList(Arrays.asList(0,1,2,3));

Leave a Comment