I have a prime class with a check method, and a main class with a main method.

Here are my files:

**prime.java**

/* * Prime Checker * Kenneth Powers * * check() accepts a long integer and returns true or false as a boolean */public class prime{ boolean prime; public boolean check(long n) { for(int i = 2; i < Math.sqrt((double)n); i++) { // set check to true for the first go if(n==2) { prime = true; } // test for primeness if(n%i==0) { prime = false; break; } } //Return The Result if(prime == true) { return true; } else { return false; } }}

**main.java**

/* * This program will find all prime numbers between 2 given long integers *///Import Scannerimport java.util.Scanner;public class main{ /** * @param args */ public static void main(String[] args) { //Set up scanner Scanner sc = new Scanner(System.in); //Set up prime checker prime p = new prime(); //Declare variables long firstNumber, secondNumber; //Get numbers from user System.out.print("Enter the first number: "); firstNumber = sc.nextLong(); System.out.print("Enter the second number: "); secondNumber = sc.nextLong(); //Start crunching (alright! (borat)) System.out.println("It's HAMMER TIME!"); for(long i = firstNumber; i < secondNumber; i++) { if(p.check(i)) { System.out.println("Prime Number: " + i); } } System.out.println("Done!"); }}

Both files are in an eclipse project called PRIME1. No matter what I type, the output of the program is as follows:

Enter the first number: 1Enter the second number: 10It's HAMMER TIME!Done!

Does anybody know what is going on? How can I fix this?