Here you can find the source of print(Collection
public static <T> void print(Collection<T> c)
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.Iterator; public class Main { public static <T> void print(Collection<T> c) { Iterator<T> it = c.iterator(); while (it.hasNext()) { System.out.println(it.next()); }/*from ww w.j ava 2 s .c o m*/ } }