Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Map;
import java.util.Map.Entry;

public class Main {
    public static <K, V> String mapToString(Map<K, V> map, String seperator) {
        StringBuffer sb = new StringBuffer();
        for (Entry<K, V> entry : map.entrySet()) {
            sb.append(entry.getKey() + seperator + entry.getValue() + "\n");
        }
        return sb.toString();
    }
}