Remove a value from hashmap based on key
I'm braindead right now. I've been coding for several hours now, and I
can't figure out the simplest things anymore.
So I have a HashMap
public HashMap<String, String> frozen = new HashMap<String, String>();
and I want to remove a value from it depending on the key. So lets say I
put in these
frozen.put("1", "1_1");
frozen.put("1", "1_2");
I want to remove only one of the values, not the whole keyset.
How would I go about doing this? If you still didn't understand, this
non-existing method should explain it.
frozen.remove("1", "1_2");
Obviously that doesn't exist, but that's what I want.
Thanks in advance.
No comments:
Post a Comment