Create a thread named NumberThread to generate a random number. If the generated number is even create a thread SumThread which generate a set of random numbers and find the sum of all numbers. If the generated number is odd create another AvgThread that generate a set of random numbers and find the average of all numbers. Write a driver class to demonstrate the multithreading program.
Answers
Answered by
1
Answer:
generate a random number. If the generated number is even create a thread SumThread which generate a set of random numbers and find the sum of all numbers. If the generated number is odd create another AvgThread that generate a set of random numbers and find the average of all numbers. Write a driver class to demonstrate the multithreading program.
Similar questions
Environmental Sciences,
2 months ago
Math,
2 months ago
Computer Science,
4 months ago
History,
9 months ago
English,
9 months ago