/* * [TestHashMapRemove.java] * * Summary: example use of java.util.HashMap. How to iterate through a HashMap removing some of the elements. * * Copyright: (c) 2009-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2008-06-19 */ package com.mindprod.example; import java.util.HashMap; import java.util.Iterator; import static java.lang.System.*; /** * example use of java.util.HashMap. How to iterate through a HashMap removing some of the elements. *
* Requires JDK 1.5+. * * @author Roedy Green, Canadian Mind Products * @version 1.0 2008-06-19 * @since 2008-06-19 */ @SuppressWarnings( { "UnusedAssignment" } ) public final class TestHashMapRemove { /** * How to iterate through a HashMap removing some of the elements. * * @param args not used */ @SuppressWarnings( "unchecked" ) public static void main( String[] args ) { // create a new HashMap HashMap