Implement the program PrimeCounter
which
- takes a minimum and a maximum number as well as a number of threads as command line arguments
- splits the given range into subranges and starts the specified number of threads each of which counts the prime numbers in one subrange
- displays the total number of found prime numbers and the required runtime
> java PrimeCounter 1 10000000 4
664579 prime numbers found in 4.859 seconds
(The table on the Wikipedia page of the prime-counting function can be used to verify the results.)