Question: Cansider the below cade: retura map + put ( k y , valoel ) roturn map - get ( k w y ) These statements
Cansider the below cade:
retura mapput valoel
roturn mapget
These statements Work in HashMap. Hash Table, and Concurrent HeshMap
This block of code generates a race condision in HashUtap, Hash Tabie, and Concurrent HashMap.
iil. In the given statements, the put method operation on whole map is locked:
N In Concurrent HashMap, put if Absent method is replacement of the above code.
v The above code is not thread sa'e in Concurtent HashMap and does cause the race condition even
Which of the following statements are correct?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
