![]() |
![]() |
|
home—info—lectures—exams—archive
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?
home—info—lectures—exams—archive
©2008, Ian Barland, Radford University Last modified 2008.Oct.29 (Wed) |
Please mail any suggestions (incl. typos, broken links) to ibarland ![]() |
![]() |