判断一个数是否为素数题目描述:给定一个整数,请编写一个Java函数来判断该数是否为素数。解答:```javapublic class PrimeNumber {public static boolean isPrime(int num) {if (num <= 1) {return false;}for (int i = 2; i <= Math.sqrt(num); i++) {if (num % i == 0) {ret