I am using an HashMap<String,Serializable> and while debugging I see the following recursively. What does that mean? Why is it so?

HashMap$EntrySet is a inner class, it has an explicit reference called this$0 to the HashMap. And the HashMap has a field private transient Set<Map.Entry<K,V>> entrySet which refers to it. So, just usual cyclic references.
The HashMap instance has a field entrySet with the type HashMap$EntrySet. Since the EntrySet class is an inner class of HashMap, it has an implicit reference to the containing instance (this$0).
This is normal and required for the EntrySet instance to access the containing HashMap instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With