0
Can someone help me with it?I want all my operations to be performed simultaneously.
3 Réponses
0
So what you are trying to do is that you have created three classes addition, subtraction and multiplication. You are creating a matrix in the main method and then you are passing it to the constructor of each class. Then you have also extended the Thread class and inside the run method you declare a variable and get the user input for that and add, subtract, and multiply it with the matrix you created. And you want all operations to show output simultaneously?
0
Yes but I am not getting the answer.
0
Why don't you less complicate it and initialize the values to the array by yourself and then try it. Also I think you need to call the start() on the reference variable of the class that you have defined in the main(). Also you need to use sleep(). You should use the synchronize keyword in the methods you defined because it provides thread safety and an operation is given enough time by the processor to complete it's task.