Boolean method
Hi everyone!
I am very new to java as you will soon notice. I am currently attending a class in college and I have a small part of my homework assignment that I am stumped on. It states that I must declare a method:
publicstaticboolean isPrime(int num)
ok, it also says that I need to use for loops and such inside it to determine whether or not a number is prime or not.; however, when I code it to do so, it says I need a return statement outside the loops. please take a look at my method and tell me what my mistake is! thanks!
-Jason
publicstaticboolean isPrime(int num)
{
for(int divisor = 2; divisor <= num / 2; divisor++)
{
if(num % divisor == 0)
{
returnfalse;
}
else
{
returntrue;
}
}
}
I get an error underline on the last closing bracket (very bottom) saying missing return statement

