Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
// The MIT License (MIT)

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

public class Main {
    public static <K, V> Map<V, K> inverse(Map<K, V> m, Map<V, K> newMap) {
        for (Entry<K, V> entry : m.entrySet()) {
            newMap.put(entry.getValue(), entry.getKey());
        }
        return newMap;
    }
}