Here you can find the source of printListPair(List
public static void printListPair(List<String> list)
//package com.java2s; import java.util.List; public class Main { /** @METHOD */ public static void printListPair(List<String> list) { if (list.isEmpty()) System.out.println("\tNO ITEM !!"); for (int i = 0; i < list.size(); i++) { System.out.print(list.get(i) + " "); if ((i + 1) % 2 == 0) System.out.println(); }/*from ww w.j av a 2s . c om*/ } }