Sample code from an Introduction to Java class.