I think I have wrote the method correctly but when I try to input a number in the main method and run the script I get no output in console. Please help.
public class Q2_Prime {
public static void main(String[] args) {
// TODO Auto-generated method stub
isPrime(19);
}
public static boolean isPrime(int number)
{
for(int i = 2; i < number; i++)
{
if(number % i == 0)
{
return false;
}
}
return true;
}
}