Introduction to OOP | Chapter 4: Classes and Methods: | next | previous | audio | real | text |
Constant data fields can be declared as public, since they cannot be changed.
class PlayingCard { // Java example ... public static final int Spade = 1; public static final int Diamond = 2; public static final int Club = 3; public static final int Heart = 4; }