Can someone explain me how this is working it is checking prime numbers?
package javaapplication5; import java.util.Scanner; /** * * @author faakeer */ public class JavaApplication5 { /** * @param args the command line arguments */ ;public static void main(String[] args) { // TODO code application logic here Scanner Scan = new Scanner(System.in); int prime = 0; while (true) { System.out.println("Please enter a number"); prime = Scan.nextInt(); boolean isprime = true; for (int x = 2; x < (prime - 1); x++) { if ((prime % x) == 0) { isprime = false; } } if (isprime) { System.out.println("It is a prime"); } else { System.out.println("It is not a prime"); } } } }