title: My program is not finding a defined method within another class
body: <p>My card class where the method is defined.</p>
  
  <pre><code>package blackjackgamemodel;
  
  public class Card {
      protected Rank rank;
      protected Suit suit;
  
      public Card(Card.Rank rank, Card.Suit suit) {
          this.rank = rank;
          this.suit = suit;
      }
  
      public String toString() {
          return "" + rank + " of " + suit;
      }
  
      public Card.Rank rank() {
          return rank;
      }
  
      public Card.Suit suit() {
          return suit;
      }
  
      public enum Rank {
          ACE (1), TWO (2), THREE (3), FOUR (4), FIVE (5), SIX (6), SEVEN (7),
          EIGHT (8), NINE (9), TEN (10), JACK (11), QUEEN (12), KING (13);
  
          private int value;
  
          Rank(int value) {
              this.value = value;
          }
  
          public int value() {
              return value;
          }
      }
  
      public enum Suit {
          SPADES, HEARTS, CLUBS, DIAMONDS
      }
  
  }
  </code></pre>
  
  <p>The game class where the error is</p>
  
  <pre><code>package blackjackgamemodel;
  
  import blackjackgamemodel.Card;
  import blackjackgamemodel.Deck;
  
  public class Game {
      protected Deck deck;
      protected int sum;
      protected int aces;
  
  
      public Game() {
          // Initialize deck, sum and aces.
          deck = new Deck();
          sum = 0;
          aces = 0;
      }
  
      public Card draw() {
  
          // Draw a card from the deck
          Card drawn_card = deck.draw();
  
          // Calculate the value to add to sum
          int v = drawn_card.value();
          if (v == 1) {
              v = 11;
              // If the card is an ace, increase the count of aces.
              aces++;
          }
          else if (v &gt; 10) {
              v = 10;
          }
          // Now v is the Blackjack value of the card.
  
          // If the sum is greater than 21 and there are aces,
          //   Then decrease the sum by 10 and the aces by 1.
          if (aces &gt; 0 &amp;&amp; sum &gt; 21) {
              sum = sum - 10;
              aces = aces - 1;
          }
  
          // Return the card that was drawn.
      return drawn_card; 
  
      }
  
      public int sum() {
          // Getter for sum.
          return sum;
  
      }
  }
  </code></pre>
  
  <p>ERROR</p>
  
  <pre><code>Description Resource    Path    Location    Type
  The method value() is undefined for the type Card   Game.java   /BlackJack/src/blackjackgamemodel   line 25 Java Problem
  </code></pre>