// JavaBasics.java // Demonstrates methods, variables, conditionals, arrays, recursion, etc... class JavaBasics { /////////////////////////////////// /// PrimeDemo /////////////////////////////////// public static boolean isDivisibleBy(int n, int k) { return (n % k == 0); } // can speed up by only testing odds and also by only checking // up to the square root of n public static boolean isPrime(int n) { if (n < 2) return false; for (int counter=2; counter