Prime Directive

https://www.codecademy.com/courses/learn-java/projects/java-prime-directive

I am working on Prime Directives and when compiling, i receive the error “Identifier Expected”.
Here is my code:

import java.util.ArrayList;
class PrimeDirective {

public static void main(String args) {

PrimeDirective pd = new PrimeDirective();
int[] numbers = {6, 29, 28, 33, 11, 100, 101, 43, 89};}

public boolean isPrime(int number){
if(number == 2){
return true;
}else if (number < 2){
return false;
}
// check divisibility here
for (int i = 2; i < number; i++) {
if (number % i == 0){
return false;
}
}
return true;
}
System.out.println(pd.isPrime(6));
}

Put your print statement inside the main function

1 Like

thought i tried that, but now it works, thanks!

1 Like