Java programs to demonstrate whether a given integer is prime number in 3 different ways