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
English,
2 months ago
Economy,
2 months ago
Social Sciences,
2 months ago
Computer Science,
5 months ago
History,
10 months ago
English,
10 months ago