Efficiently determining if a number is prime
A faster method would be to skip all even numbers and only try up to the square root of the number.

public static boolean isPrime(int num){
    if ( num &gt; 2 &amp;&amp; num%2 == 0 ) {
        System.out.println(num + " is not prime");
        return false;
    }
    int top = (int)Math.sqrt(num) + 1;
    for(int i = 3; i &lt; top; i+=2){
        if(num % i == 0){
            System.out.println(num + " is not prime");
            return false;
        }
    }
    System.out.println(num + " is prime");
    return true; 
}