Features to Note

Here are some features of note in this class description. Note once more the use of the pseudo-variable super in the constructor, to indicate the arguments to be passed to the constructor in the parent class.

Notice the syntax used to access static functions, such as the random number generator class provided by the Java run-time library as part of the class Math.

Finally, note that the assertion that Java does not have global variables is true only in a very narrow sense. Static data fields serve much the same purpose, and are used in the same way. Here we are accessing the global data field named by Solitare.discardPile, which we will see defined shortly.

[audio] [real] Text to accompany slide19, in Chapter 8 of An Introduction to Object-Oriented Programming