Java tutorial
//package com.java2s; import java.util.HashMap; import java.util.Map; public class Main { public static void clearMap(Map hash) { if (hash != null) { hash.clear(); } hash = null; } public static void clearMap(HashMap hash) { if (hash != null) { hash.clear(); } hash = null; } }