Your lucky i'm bored today ;)
Try this:
import javax.swing.JOptionPane;
import java.util.ArrayList;
public class PrimeNumber
Type: Posts; User: JavaPF
Your lucky i'm bored today ;)
Try this:
import javax.swing.JOptionPane;
import java.util.ArrayList;
public class PrimeNumber
I've used an ArrayList here to store the results and then display them with the JOptionPane.
The JOptionPane is one massive box at the moment. You'll need to figure out how to add a new line...
Try this. Only problem is it shows each prime number one by one..
import javax.swing.JOptionPane;
public class PrimeNumber
{
public static void main (String[] args)
{
System.out.println("Enter a value: ");
Scanner input = new Scanner(System.in);
int Odd = input.nextInt();
What are you expecting to happen?
Ummmm try adding:
public static void main(String[] args){
}
You will need to call your boolean method from within this main method.
Hello 03EVOAWD.
You are getting this error because of this method:
public static boolean isPrime(int num) {
}