I do not understand the following: 1) I convert the date into a String and check if it contains a certain month if so I remove the entry. I do not get an error but the code doesn't remove any 2) I tried to use an iterator but somehow I can't get date.getMonth() to work. I do not understand why? 3) The solution on CodeGym is incomprehensible to me. Why use a copy of the original map? What does that do? And secondly why does getMonth() works there and not in my code?? My understanding is that the map has key: value pairs. In this case key is a name with String as datatype. The values are the birthdays with Date as datatype. So if I iterate over this map I'm looking for the values which contain certain months. I also understand that you can't iterate and remove entries at the same time unless you specifically create an iterator. So where do I go wrong with my code. What is wrong in my thinking?
Almost a year later and I still do not understand how this works