educative.io

The code with synchronyzed blocks doesn't show any output

As the title mentions, the solution code with synchronized blocks doesn’t show any output. It might be because the threads are having a serial execution now that there are synchronized blocks. So by the time printer calculates something, randInt is already 0.