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
|
340 Discussions
|
Please Login in order to post a comment
Here is my solution to this problem:
` public class Solution {
static class Prime { public void checkPrime(int... numbers) { for (int num : numbers) { if (isPrime(num)) { System.out.print(num + " "); } } System.out.println(); }
} } `
this is a very simple way to check PrimeNumber static class Prime {
Here is the solution:
import java.io.; import java.util.; import java.lang.reflect.Method;
class Prime { public void checkPrime(int ... n) { for (int j=0;j
} }
public class Solution {
}