title: Prime Number checker is not working
body: <p>This is the code for a function that is supposed to  return true if the input is prime and returns false if it is not.  </p>
  
  <p>This is how I intended for it to work:  lets say that y = 7, the loop starts with n=1. Since 1(n) is less that 7(y) the loop can iterate. The program checks if y divided by n has a remainder of 0, meaning that n is a factor of y. If it is true, then it checks to see if the factor does not equal 1 or y (7), because if they dont then that means that y has more factors other than its self and 1, meaning that it is not prime, so it should automatically end the function and return false. but since 7 has only two factors, 1 and 7, and they either equal 1 or itself (y) then after the end of the loop, it should return true.</p>
  
  <p>I don't understand why it isn't working.  </p>
  
  <pre><code>    public static boolean checkIfPrime(long y) {
      for ( long n =1L; n &lt;= y; n++) {
          if(y%n == 0) {
              if( n != 1L || n != y) { 
                  return false;
              }
  
          }
      }
      return true;
  }
  </code></pre>