Scenario
Implementing the sieve of Eratosthenes algorithm to find allprime numbers up to a given limit.
Aim
Develop code for implementing the sieve of Eratosthenes.
Steps for Completion
Implement the isPrime() method of the SieveOfEratosthenes classthat should return true if the number is prime, and falseotherwise.
Consider building the sieve in the class constructor.
CODE GIVEN
public class SieveOfEratosthenes {
public SieveOfEratosthenes(int maxValue) {
// Build the sieve here
}
public boolean isPrime(int value) {
// Write your code here
}
}