This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The Timer is smart enough to know that something is supposed to be done -- it just doesn't have a clue what. A TimerTask subclass, here an annoymous class, handles the actions. If you know about threads, this is similar to
The code Sun wrote could also be written like this:
[ April 06, 2002: Message edited by: Cindy Glass ]