Unfortunately, we don't allow code to be posted in this forum ... only pseudocode.
It would be more helpful, however, if you copy and paste the exact error message you are receiving instead of the code.
Remember that when you construct a new HashMap the contents are still null (similar to when you construct an array). So when you construct the HashMap all the keys and all the values are null until you put something in it.
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Marilyn de Queiroz
Joined: Jul 22, 2000
The other thing to remember is that if you do a get() on a HashMap and the key is not found, you will get a null.
Joined: Apr 16, 2008
Thank you very much for your help! I resolved my issue. HashMap get() was cause of NullPointerException. Method asks for INT parameter but I pass something else.