If you remove the synchronized keyword from both methods then you would probably get different results every time you run the program.
There is nothing wrong with the loops, they are looping exactly...
Type: Posts; User: OutputStream
If you remove the synchronized keyword from both methods then you would probably get different results every time you run the program.
There is nothing wrong with the loops, they are looping exactly...
Basic math:
3 * 2'000'000 = 6'000'000
1 * 2'000'000 = 2'000'000
Add them together and you get 8'000'000.
How can 7'999'982 be the right output?