The Object and its Class
public class Card {
int suit, rank; // instance variables
public Card(int s, int r) { // a constructor
suit = s; rank = r; }
public void paint (Graphics g) {
/* code to draw the card */
}
public int getSuit() { return suit; }
public int getRank() { return rank; }
}
Previous slide
Next slide
Back to first slide
View graphic version