How to use wait and notify in Java without IllegalMonitorStateException?

后端 未结 12 2154
后悔当初
后悔当初 2020-11-22 02:21

I have 2 matrices and I need to multiply them and then print the results of each cell. As soon as one cell is ready I need to print it, but for example I need to print the [

12条回答
  •  粉色の甜心
    2020-11-22 03:02

    For this particular problem, why not store up your various results in variables and then when the last of your thread is processed you can print in whatever format you want. This is especially useful if you are gonna be using your work history in other projects.

提交回复
热议问题