java how to print an array

Java
import java.util.Arrays;

public class Array {

    public static void main(String[] args) {
        int[] array = {1, 2, 3, 4, 5};

        System.out.println(Arrays.toString(array));
    }
}int[] intArray = new int[] {1, 2, 3, 4, 5};
System.out.println(intArray);     // prints something like '[I@3343c8b3'import java.util.Arrays;

class Scratch{
    public static void main(String[] args){
        int[] arr = new int[3];
        System.out.println( Arrays.toString( arr ));
      	//prints [0, 0, 0]
    }
}
Source

Also in Java: