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.Set;

public class Main {
    public static String printHashMap(Map<?, ?> inSet) {
        if (inSet == null) {
            return "null";
        }
        StringBuilder sb = new StringBuilder("[ ");
        Set<?> keys = inSet.keySet();
        for (Object key : keys) {
            sb.append("(key=").append(key).append(", value=").append(inSet.get(key)).append(") ");
        }
        sb.append("]");
        return sb.toString();
    }
}