Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.HashMap;
import java.util.Map;

public class Main {
    /**
     * Clones a map.
     *
     * @param source the source map
     * @return the clone of the source map
     */
    public static Map copy(Map source) {

        if (source == null) {
            return null;
        }

        Map result = new HashMap();
        result.putAll(source);
        return result;
    }

}