Search code examples
javahashmapclassnotfoundexception

Java HashMap.Entry class not found


I am dealing with problem. The code throws "java.lang.ClassNotFoundException: java.util.HashMap.Entry"

Class.forName("java.util.HashMap.Entry");

Anybody knows how can I create class to store HashMap.Entry?


Solution

  • Try:

    Class.forName("java.util.HashMap$Entry");
    

    (note the dollar sign.)

    This works for me.