Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.Map;

public class Main {
    public static <T> boolean removeByValue(Map<?, T> map, T value) {
        for (Map.Entry<?, T> o : map.entrySet()) {
            if (o.getValue() == value) {
                map.remove(o.getKey());
                return true;
            }
        }
        return false;
    }
}