Sieve of Eratosthenes written in Java