Here you can find the source of printArray(T[] array)
public static <T> void printArray(T[] array)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; public class Main { public static <T> void printArray(T[] array) { printArray(array, 0, array.length); }// www .j a va 2 s.c o m public static <T> void printArray(T[] array, int start, int stop) { Arrays.stream(Arrays.copyOfRange(array, start, stop)).map(s -> s + " ").forEach(System.out::print); System.out.println(); } public static void printArray(int[] array) { printArray(array, 0, array.length); } public static void printArray(int[] array, int start, int stop) { for (int i : Arrays.copyOfRange(array, start, stop)) { System.out.print(i + " "); } System.out.println(); } }