RU beehive logo ITEC dept promo banner
ITEC 380
2008fall
ibarland

homeinfolecturesexamsarchive

lect09a
scope: closures

Implementing fields. Note that each (pair of) functions has its own closure.
Exercise: make a "subclass" of rng which adds the method void skip(int n), which simply cycles past the next n random numbers. (Is this a helpful method for an rng? Nope.)

Uh-oh: Suppose we try to make a subclass of rng which contains a method getSeed. What problem do we face?

homeinfolecturesexamsarchive


©2008, Ian Barland, Radford University
Last modified 2008.Oct.29 (Wed)
Please mail any suggestions
(incl. typos, broken links)
to iba�rlandrad�ford.edu
Powered by PLT Scheme