title: Java: toString error "error: incompatible types: int cannot be converted to String"
body: <p>I just need a quick help with my <code>toString</code>. This involves playing cards.</p>
  
  <pre><code>public class Card
  {
    //Data
    private int rank;
    private char rank2;
    private char suit;
  
    //more codes (constructor etc.)
  
    //toString
      public String toString ( )
      {
      if (rank == 11)
          rank2 = 'J';
      else if (rank == 12)
          rank2 = 'Q';
      else if (rank == 13)
          rank2 = 'K';
      else if (rank == 14)
          rank2 = 'A';
      else
          return rank2 + suit; // &lt;----error here.
      }
  </code></pre>
  
  <p>I am trying to figure out how to return a rank and a suit. For example, if someone were to input 11 for the rank and 'S' for the suit, then I should return a JS. However, I am running into an error:</p>
  
  <blockquote>
    <p>"error: incompatible types: int cannot be converted to String"</p>
  </blockquote>