|
|
|||||||||
PREV
CLASS NEXT CLASS |
|
|||||||||
|
java.lang.Object
Card
public class Card
extends java.lang.Object
An encapsulation of a card in a deck of "playing cards". A card
has a suit ("Clubs", "Diamonds", "Hearts" or
"Spades") and a value ("2", "3", ...,
"10", "Jack", "Queen", "King", or
"Ace")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Constructor Summary |
|
|
|
Method Summary |
|
|
|
|
|
|
|
Methods inherited from class java.lang.Object |
|
public static final int CLUBS
See Also:
public static final int DIAMONDS
See Also:
public static final int HEARTS
See Also:
public static final int SPADES
See Also:
public static final int JACK
See Also:
public static final int QUEEN
See Also:
public static final int KING
See Also:
public static final int ACE
See Also:
public Card(int suit,
int value)
Explicit Value Constructor
Parameters:
suit
- The suit (CLUBS, DIAMONDS, HEARTS, SPADES)
value
- The value (2, 3, ... 10, JACK, QUEEN, KING, ACE)
public java.lang.String getSuit()
Get a String representation of the
suit of this Card
Returns:
"Clubs",
"Diamonds", "Hearts" or "Spades"
public java.lang.String getValue()
Get a String representation of the
value of this Card
Returns:
"2", "3", ...,
"10", "Jack", "Queen", "King", or
"Ace"
public java.lang.String toString()
Return a formatted String
representation of this Card (that contains the suit and value)
Returns:
The String representation of this
Card
|
|
|||||||||
PREV
CLASS NEXT CLASS |
|
|||||||||
|