Hello!
I'm currently making a new program that will count how many prime numbers there is between two numbers (let's say 1 - 50).
I just wonder how do I make this method? Or do I need a for loop also?
This is how far I have become atm.. Please tell me if I have made something wrong.
OBS! There will also be a class with a main method which is not created yet.
import java.util.Scanner; class Prime { private int number1; private int number2; private int[] primenumber1; public Prime(int n1, int n2, int[] p1 ); { System.out.print("Write in the first number:"); int under = s.nextInt(); System.out.print("Write in the second number:"); int over = s.nextInt(); this.number1 = n1; this.number2 = n2; this.primenumber1 = p1; } public int getNumber1() { return this.Number1; } public void setNumber1() { this.number1 = n1; } public int getNumber2() { return this.Number2; } public void setNumber2() { this.number2 = n2; } public int getPrime() { return this.primenumber1; } }