title: Access enum from another class
body: <p>I am new to Java and I am struggling to get my Enumeration to work. I am working in BlueJ and I have 2 classes (trying to build a game of solitaire). my first class is called Card and inside this class I have an enumeration called Suit. My other class is Deck and I am trying to call the enumeration from this class. My problem is in the for loop for deck where I have declared Suit suit. It does not recognize the class Suit. </p>
  
  <p>My code is below, if anyone can tell what I am doing wrong... it would be much appreciated. Thanks!</p>
  
  <pre><code>public class Deck
  {
  
  private Bag&lt;Card&gt; cardBag = new Bag&lt;Card&gt;();
  
  public Deck()
  {
    for(Suit suit : Suit.values())
       {
           Card card= new Card (suit, 5);
       }
   }
  </code></pre>
  
  <p>//</p>
  
  <pre><code>public class Card
  {
  public enum Suit
  {
      H, S, C, D
  }
  
  private Suit suit;
  private int valueOfCard;
  
  public static final int ACE = 1;
  public static final int JACK = 11;
  public static final int QUEEN = 12;
  public static final int KING = 13;
  
  public Card(int valueOfCard, Suit suit)
  {
      this.valueOfCard= valueOfCard;
      this.suit=suit;
  }
  }
  </code></pre>