Hi, I need to write a pontoon game. So far i wrote the Deck and Card classes. When i try to print the toString in my deck class i get "Deck@6612fc02". What i wanted is to print 13 cards on each row. May you help me thanks.
public class Deck
{
private LinkedList<Card> card = new LinkedList <Card>();
private Iterator <Card> it;
private char[] suit = {'H','D','C','S'};
public Deck()
{
for(int i = 0; i< 4; i++)
{
for(int j = 1; j <= 13; j++)
card.add(new Card(j,suit[i]));
}
}
public void show()
{
System.out.println(toString());
}
public String toSring()
{
String s = " ";
for(int i =0; i < 13; i++)
{
s = card.toString() + "\n";
}
return s;
}
}
public class Card
{
private int value;
private char suit;
public Card(int value, char suit)
{
this.value = value;
this.suit = suit;
}
public String toString()
{
String s= suit + " " + value;
return s;
}
}