Write a Java program to check whether the number is a prime number or not