Write a Java program to check if a given number is prime or not i.e. a number which is not divisible by any other number other than 1 and itself.
Write a Java program to check if a given number is prime or not i.e. a number which is not divisible by any other number other than 1 and itself.