Java error "Undefined name"
<p>I've tried fixing this I just cant seem to find a solution to this problem. The code is meant to print the prime numbers in a range, but it just returns the error</p>

<blockquote>
  <p>Static Error: Undefined name 'PrimeNumbers</p>
</blockquote>

<p>Would anyone please be able to help me ?</p>

<p>This is my code :</p>

<pre><code>import java.util.*;

public class PrimeNumbers { 

    private List&lt;Integer&gt; listOfPrimeNumbers;  //add a member variable for the ArrayList
    public static void main(String args []){    
      PrimeNumbers primeNumberList = new PrimeNumbers(50);
      primeNumberList.print();  //use our new print method
    }

public PrimeNumbers (int initialCapacity) {
    listOfPrimeNumbers = new ArrayList&lt;Integer&gt;(initialCapacity/2);  //initialCapacity/2 is an easy (if not tight) upper bound
    long numberOfPrimes = 0; //Initialises variable numberOfPrimes to 0
    int start = 2;
    boolean[] isPrimeNumber = new boolean[initialCapacity + 1];

    for (int i=0;i==initialCapacity;i++) {//setting all values in array of booleans to true
    isPrimeNumber[i] = true;
    }
     while (start != initialCapacity)
        {
          if (isPrimeNumber[start])
          {
            listOfPrimeNumbers.add(start);
            //add to array list
            numberOfPrimes++;
            for (int i = start; start &lt; initialCapacity; i+=start)
            {
              isPrimeNumber[i] = false;
            }
          }
          start++;
        }
    }

  public void print() {
    int i = 1; 
    for (Integer nextPrime:listOfPrimeNumbers) {
      System.out.println("the " + i + "th prime is: " + nextPrime);
      i++;
    }
  }
 //or just System.out.println(listOfPrimeNumbers);, letting ArrayList's toString do the work.  i think it will be in [a,b,c,..,z] format

 public List getPrimes() {
   return listOfPrimeNumbers;
 } //a simple getter isnt a bad idea either, even though we arent using it yet
}
</code></pre>
