-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCard.java
More file actions
34 lines (33 loc) · 695 Bytes
/
Copy pathCard.java
File metadata and controls
34 lines (33 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
public class Card
{
private int value;
private String suit;
private String rank;
public Card(int vl, String st, String rk)
{
// initialise instance variables
value = vl;
suit = st;
rank = rk;
}
//returns card value
public int getValue(){
return value;
}
//sets new value of card, used for aces
public void setValue(int vl){
value = vl;
}
//returns card suit
public String getSuit(){
return suit;
}
//returns card rank
public String getRank(){
return rank;
}
//gives info on card
public String toString(){
return rank + " of "+ suit;
}
}