How to print an int array in Java?

To print an int array in Java, use Arrays.toString.

Here's how you do it:

int[] array = new int[] { 1, 5, 33 };

// [1, 5, 33]
System.out.println(java.util.Arrays.toString(array));