Here you can find the source of print1DIntArray(int[] array)
public static void print1DIntArray(int[] array)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; public class Main { public static void print1DIntArray(int[] array) { printArray(getBoxedIntArray(array)); }//from w w w .ja va2 s. co m public static <T> void printArray(T[] array) { int len = array.length; System.out.print("["); for (int i = 0; i < len; i++) { if (i != len - 1) { System.out.print(array[i] + ", "); } else { System.out.println(array[i] + "]"); } } } public static Object[] getBoxedIntArray(int[] nums) { if (nums == null) { return null; } return Arrays.stream(nums).boxed().toArray(); } }