Java List Print print(List list)

Here you can find the source of print(List list)

Description

print

License

Open Source License

Declaration

public static <E> void print(List<E> list) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.List;
import java.util.Map;

public class Main {

    public static void print(String str) {
        System.out.println(str);/*from www  .  j  ava2  s. c  o m*/
    }

    public static <E> void print(List<E> list) {
        for (E li : list)
            System.out.println(li);
    }

    public static <K, V> void print(Map<K, V> map) {
        for (Map.Entry<K, V> m : map.entrySet()) {
            System.out.println(m.getKey() + " , " + m.getValue());
        }
    }

    public static <K, V> void print(Map<K, V> map, int n) {
        int k = 0;
        for (Map.Entry<K, V> m : map.entrySet()) {
            System.out.println(m.getKey() + " , " + m.getValue());
            k++;
            if (k > n)
                break;
        }
    }

    public static void print(double d) {
        System.out.println(d);
    }
}

Related

  1. print(Collection> collections)
  2. print(int totalErrors, int totalTechnical, int totalSuccess, List filesWithErrorsList)
  3. print(Iterable list)
  4. print(List A, String mode)
  5. print(List items)
  6. print(List list)
  7. print(List list)
  8. print(Map> map)
  9. print_int(List l)