Hackerrank Java Advanced Challenges: Prime Checker

Hackerrank has sets of beautifully crafted advance java challenges for the programmers to get detailed knowledge of concepts and basic tools that would help us to solve tougher coding problems.
You can access the these set of problems here:

The problem statement is as follows:
Your task is to create a class Prime. The class Prime should contain a single method checkPrime.
The locked code in the editor will call the checkPrime method with one or more integer arguments. You should write the checkPrime method in such a way that the code prints only the prime numbers.

Sample Input

Sample Output

Solution lies here

Thanks for visiting, checkout the solutions of remaining problems 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *