title: Java problem - method undefined even though I already defined it in the package
body: <p>I'm a total beginner in Java and I'm working on an assignment that's largely prefabricated/preformatted code, but I can't get it to work. In Eclipse, I get an error saying "<strong>Method cardToString(MyCard) is undefined for the type MyCardTester</strong>" before I even run it. I've looked at similar questions on Stackoverflow,</p>
  
  <p>(<a href="https://stackoverflow.com/questions/11671789/eclipse-is-telling-me-a-method-is-undefined-when-it-clearly-is-in-fact-defined">Eclipse is telling me a method is undefined when it clearly is in fact defined</a>, <a href="https://stackoverflow.com/questions/19889827/the-method-is-not-defined-for-the-type-error-in-simple-program-in-java">&quot;The method is not defined for the type&quot; error in simple program in java</a>)</p>
  
  <p>and they have different problems from me. I think that my problem may be with my classpath or run configuration, but those settings seem fine. Here is the code:</p>
  
  <p>Here's the first class:
  </p>
  
  <pre><code>package EllevensGame;
  import EllevensGame.MyCard;
  import java.lang.String;
  
  /**
   * This is a class that tests the Card class.
   */
  
  public class MyCardTester {
  
      /**
       * The main method in this class checks the Card operations for consistency.
       *  @param args is not used.
       */
      public static void main(String[] args) {
          MyCard testCard = new MyCard("King", "Hearts", 13);
          String printStuff = cardToString(testCard);
          System.out.println(printStuff);
      }
  }
  </code></pre>
  
  <p>Second class:</p>
  
  <pre><code>package EllevensGame;
  /**
   * MyCard.java
   *
   * &lt;code&gt;MyCard&lt;/code&gt; represents a playing card.
   */
  import java.lang.String;
  
  public class MyCard {
  
      /**
       * String value that holds the suit of the card
       */
      protected String suit;
  
      /**
       * String value that holds the rank of the card
       */
      protected String rank;
  
      /**
       * int value that holds the point value.
       */
      protected int pointValue;
  
  
     /**
       * Creates a new &lt;code&gt;Card&lt;/code&gt; instance.
       *
       * @param cardRank  a &lt;code&gt;String&lt;/code&gt; value
       *                  containing the rank of the card
       * @param cardSuit  a &lt;code&gt;String&lt;/code&gt; value
       *                  containing the suit of the card
       * @param cardPointValue an &lt;code&gt;int&lt;/code&gt; value
       *                  containing the point value of the card
       */
      public MyCard(String cardRank, String cardSuit, int cardPointValue) {
          //MyCard newCard = new MyCard(cardRank, cardSuit, cardPointValue); Not sure if this is right or not 
      }
  
  
      /**
       * Accesses this &lt;code&gt;Card's&lt;/code&gt; suit.
       * @return this &lt;code&gt;Card's&lt;/code&gt; suit.
       */
      public String suit() {
          return suit;
     }
  
      /**
       * Accesses this &lt;code&gt;Card's&lt;/code&gt; rank.
       * @return this &lt;code&gt;Card's&lt;/code&gt; rank.
       */
      public String rank() {
          return rank;
      }
  
     /**
       * Accesses this &lt;code&gt;Card's&lt;/code&gt; point value.
       * @return this &lt;code&gt;Card's&lt;/code&gt; point value.
       */
      public int pointValue() {
          return pointValue;
      }
  
      /** Compare this card with the argument.
       * @param otherCard the other card to compare to this
       * @return true if the rank, suit, and point value of this card
       *              are equal to those of the argument;
       *         false otherwise.
       */
      public boolean matches(MyCard otherCard) {
          if (otherCard.pointValue == (pointValue()) &amp;&amp; (otherCard.rank.equals(rank)) &amp;&amp; (otherCard.suit.equals(suit))) {
              return true;
          }
          else {return false;}
      }
  
      /**
       * Converts the rank, suit, and point value into a string in the format
       *     "[Rank] of [Suit] (point value = [PointValue])".
       * This provides a useful way of printing the contents
       * of a &lt;code&gt;Deck&lt;/code&gt; in an easily readable format or performing
       * other similar functions.
       *
       * @return a &lt;code&gt;String&lt;/code&gt; containing the rank, suit,
       *         and point value of the card.
       */
      //@Override
      public String cardToString(MyCard newCard) {
          String pointstring = String.valueOf(pointValue);
          String print = rank + " of " + suit + pointstring;
          return print;
      }
  }
  </code></pre>
  
  <p>Final note: the code is supposed to create a "card" object for a card game (Ellevens).</p>
  
  <p>Thanks!!</p>