09: What is wrong with this code? HashMap & Race condition

Q. What is wrong with the following code snippet?

A. It is NOT thread-safe as a “HashMap” is not thread-safe as per the Java API, and race conditions can leave the “map” in “inconsistent state”. It is very hard…

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only.

Register

50+ Free Java FAQs

50+ Free Big Data FAQs

Already a member? Log in here

300+ Java Interview FAQs

Tutorials on Java & Big Data