We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Java
- Advanced
- Prime Checker
- Discussions
Prime Checker
Prime Checker
Sort by
recency
|
357 Discussions
|
Please Login in order to post a comment
Sieve of Eratosthenes
I never use
import static
before, this problem gives me good insight. Also, searching for math equation for checkPrime and adapt it to java is fun, and it remind me that (int / int( will automatically truncate decimal point !!here is my solution:
solution for java 8 import java.io.; import java.util.;
public class Solution {
}
you can add
import static java.lang.System.in;
in java 7 to fix the compilation error
and enjoy