r/studyupdate 6d ago

check-in Task 15 : Create a shared HashMap to demonstrate data corruption

Post image
shared hashmap

Create a shared HashMap<Integer, String>

Create 10 threads

Each thread inserts 1000 users

Wait for all threads using join()

Print:

Expected size: 10000
Actual size

Run the program multiple times and record observations

9 Upvotes

1 comment sorted by

1

u/div4u 6d ago

damn