title: Enum Inside Class
body: <p>I am trying to define an enum within a class but Eclipse continues to underline my code in the lovely red color. Here is what my code looks like for the most part:</p>
  
  <pre><code>package campusvilleFoodBank;
  
  import java.util.NoSuchElementException;
  import java.util.Scanner;
  
  public class FoodArrayList {
  
      public enum Days {SUN, MON, TUE, WED, THUR, FRI, SAT}
  
      private Food [] foodArray;
      private int iterator;
      private boolean startIndexing;
      private static final int MAX = 24;
  
      public FoodArrayList(){
          foodArray = new Food [MAX];
          iterator = 0;
      }
  
      public FoodArrayList(int arraySize){
          foodArray = new Food [arraySize];
          iterator = 0;
      }
  //Rest of code, with more complicated methods here
  }
  </code></pre>
  
  <p>I must be missing something very simple, it's likely to be a syntax error.... The code that follows involves methods such as my <code>toString()</code>, some sorting methods for the <code>foodArray</code> instance variable, and things along those lines. I do not have a main method defined. I know that I can define an enum within a class definition and all of the code I've seen elsewhere is written nearly exactly the same as to what I have. However, Eclipse does not seem to recognize even the <code>enum</code> declaration and I don't believe I need to import anything. </p>
  
  <p>Here is what I see in Eclipse for the code I have an error with:</p>
  
  <p><a href="https://i.stack.imgur.com/aDLwI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/aDLwI.png" alt="Code with error"></a></p>
  
  <p>For comparison, here is some enum code from another, separate .java file that appears to be without error:</p>
  
  <p><a href="https://i.stack.imgur.com/xJlTR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/xJlTR.png" alt="Code without error"></a></p>
  
  <p>Any assistance on this would be appreciated. Let me know if further clarification is needed. </p>