Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.Iterator;
import java.util.concurrent.ConcurrentHashMap;

public class Main {
    public static <T1, T2> void removeHashMapElementByHash(ConcurrentHashMap<T1, T2> target, int hashcode) {
        Iterator<T1> iter = target.keySet().iterator();
        Object key = null;
        while (iter.hasNext()) {
            key = iter.next();
            if (key.hashCode() == hashcode) {
                target.remove(key);
            }
        }
    }
}