Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.HashMap;

import java.util.Map;

public class Main {
    public static <K, V, V2> Map<V, V2> getOrCreateMap(Map<K, Map<V, V2>> map, K key) {
        Map<V, V2> r = map.get(key);
        if (r == null)
            map.put(key, r = new HashMap<V, V2>());
        return r;
    }
}