Java Programming Exercise : Prime number checker code example

These code use to check if a number is prime or not.
import java.util.Scanner;

public class EvenOddCheck {

  * @param args
 public static void main(String[] args) {
  // TODO Auto-generated method stub
  int input;
  String prime="Not Prime";
  Scanner myScanner = new Scanner(;
  System.out.print("Please input number:");
  input = myScanner.nextInt();
  for(int i=2;i<Math.sqrt(input);i++){
    prime="Prime number.";


Feel free to comment here. Good luck.