static boolean allPrime(int[] A, int n) { for(int i = 0; i < n; i++) { if(!isPrime(A[i])) { return false; } } return true; }