Here you can find the source of printEachLine(List
public static <T> void printEachLine(List<T> list)
//package com.java2s; //License from project: Open Source License import java.util.List; import java.util.Map; import java.util.Map.Entry; public class Main { public static <K, V> void printEachLine(Map<K, V> map) { for (Entry<K, V> entry : map.entrySet()) { System.out.println(entry); }/*from w w w . jav a2s . c o m*/ } public static <T> void printEachLine(List<T> list) { for (T entry : list) { System.out.println(entry); } } }