Having trouble with java card game
<p>Before I start, yes this is a homework assignment so obviously I am not asking for any answers but I would appreciate if anyone could help me in the right direction or give me some advice.</p>

<p>Ok so for an assignment I am making a game of black jack in java. Currently I have a Card class, a Deck Class, and my Main (CardGameTester). Right now I only am doing the game with one player (the user) so it's pretty basic. My main is quite messy and I could do with having a third class but I've decided to do it this way instead.</p>

<p>I'm getting several strange errors that I believe are me messing up my arraylists or something to do with the objects. If anyone could help me out I would really appreciate it because I am quite stuck at the moment.</p>

<p>the errors I'm getting when I try to compile: </p>

<pre><code>6 errors and 1 warning found:
--------------
*** Errors ***
--------------
File: E:\Documents\Java Files\Assignment 3\CardGameTester.java  [line: 17]
Error: The method add(Card) in the type java.util.ArrayList&lt;Card&gt; is not applicable for the arguments (Deck)
File: E:\Documents\Java Files\Assignment 3\CardGameTester.java  [line: 28]
Error: The method add(Card) in the type java.util.ArrayList&lt;Card&gt; is not applicable for the arguments (Deck)
File: E:\Documents\Java Files\Assignment 3\CardGameTester.java  [line: 35]
Error: Type mismatch: cannot convert from Card to int
File: E:\Documents\Java Files\Assignment 3\Deck.java  [line: 15]
Error: The constructor Card() is undefined
File: E:\Documents\Java Files\Assignment 3\Deck.java  [line: 19]
Error: The method shuffle() is undefined for the type java.util.ArrayList&lt;Card&gt;
File: E:\Documents\Java Files\Assignment 3\Deck.java  [line: 30]
Error: c cannot be resolved
-------------
** Warning **
-------------
File: E:\Documents\Java Files\Assignment 3\Card.java  [line: 5]
Warning: The field Card.suits is never read locally
</code></pre>

<p>Here is Card.java</p>

<pre><code>public class Card
{
  private int rankValue, suitValue;
  private String ranks[] = {"Hearts", "Clubs", "Spades", "Diamonds"};
  private String suits[] = {"Ace", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King"};

  public Card(int rank, int suit)
  {
    rankValue = rank;
    suitValue = suit;
  }

  public String convertToString(int rank){
    return ranks[rank];
  }

  public void setRank(int rank){
    rankValue = rank;
  }

  public void setSuit(int suit){
    suitValue = suit;
  }

  public int getRank(){
    return rankValue;
  }

  public int getSuit(){
    return suitValue;
  }

  public String toString(){
    return "Rank: " + rankValue + "Suit: " + suitValue;
  }
}
</code></pre>

<p>Here is Deck.java:</p>

<pre><code>import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Deck
{
  private ArrayList&lt;Card&gt; cards = new ArrayList&lt;Card&gt;();

  public Deck()
  {
    for(int a = 1; a &lt;= 4; a++)
    {
      for(int b = 1; b &lt;= 13; b++)
      {
        Card c = new Card();
        cards.add(c);
      }
    }
    cards.shuffle();
  }

  public void shuffle(){
    Collections.shuffle(cards);
  }

  public String deal(){
    int index = 0;
    cards.get(index);
    cards.remove(index);
    return "You have been dealt a: " + c.toString();
    index++;
  }
}
</code></pre>

<p>and here is my Main CardGametester.java: </p>

<pre><code>public class CardGameTester
{
  public static void main(String[] args)
  {
    ArrayList&lt;Card&gt; hand = new ArrayList&lt;Card&gt;();
    Deck d = new Deck();

    Scanner scan = new Scanner(System.in);
    System.out.println("Welcome to the game of Black Jack!\nWould you like to Start?");
    String input = scan.nextLine();
    if(input == "yes")
    {
      d.deal();
      hand.add(d);
    }

    String input2;

    while (input2 == "yes")
    {
      Scanner keyboard = new Scanner(System.in);
      System.out.println("Would you like to hit or stay?");
      input2 = keyboard.nextLine();
      d.deal();
      hand.add(d);
    }

    int total;

    for(int index = 0; index &lt;= hand.size(); index++)
    {
      total = hand.get(index);
    }

    System.out.println("Your total value for you cards are: " + total);

    if(total &lt;= 21){
      System.out.println("Congrats, you have won for not going over 21");
    }
    else
      {
        System.out.println("Sorry, you lose for going over 21");
    }
  }
}
</code></pre>
