Basically I have an object class
public class Card { private int value; // value of card (1-10, ...) // return String representation of Card public String toString() { return face + suit; } // end method toString public int getValue() { return value; } } // end class Card
Sooo this Card object gets used multiple times and put into an array. But my problem is that I can't get figure out how to get to the Value of the card..
I've been using this to print out the card i get from the array
System.out.println(myDeckOfCards.getDeck()[ 0 ]);
But, as you can see from the toString() Method up there it will only return the face and the suit. How do i get it to return the Value (on its own)? Or how can I access the Value for that particular element in the array?
Thanks so much for any help.