the full java code please with comments
Write a method that determines whether a positive integer is a prime number (a positive integer number is prime if it is only divisible by itself and 1). For example, the numbers 2, 3, 5, and 31 are primes, and the numbers 4, 6, 8, and 32 are primes. Also write a program to test your method. Show transcribed image text Write a method that determines whether a positive integer is a prime number (a positive integer number is prime if it is only divisible by itself and 1). For example, the numbers 2, 3, 5, and 31 are primes, and the numbers 4, 6, 8, and 32 are primes. Also write a program to test your method.
Expert Answer
Answer to Write a method that determines whether a positive integer is a prime number (a positive integer number is prime if it is…