title: Java Prime Number check with User Input
body: <p>I just started coding for college and I had to write a program that checks user inputs (integers) if they're a prime number or not.</p>
  
  <p>I've been getting good results but I wanted to ask for your opinion and whether I forgot something.</p>
  
  <pre><code>package uebung_3;
  
  
  import java.util.Scanner;
  
  public class PrimZahlen {
  
      public static void main(String[] args) {
  
          System.out.print("Enter a number: ");
          Scanner key = new Scanner(System.in);
          int in = key.nextInt();
  
          prim(in);
      }
  
      private static void prim(int in) {//int in is a Scanner var.
          if (in == 2 || in == 3) {
  
              System.out.println(in + " is a prime number");
          } else if (in == 5 || in == 7) {
              System.out.println(in + " is a prime number");
          } else if (in % 2 == 0 || in % 3 == 0) {
              System.out.println(in + " is not a prime number.");
          } else if (in % 5 == 0 || in % 7 == 0) {
              System.out.println(in + " is not a prime number.");
          } else {
              System.out.println(in + " is a prime number.");
          }
      }
  
  }
  </code></pre>