There is an important point to note about this digital clock applet.

It uses threads!

We have overridden the start() and stop() methods in the Applet class, and put an endless loop inside the run() method.

If we had taken a "short cut" and simply put the endless loop inside the init() method, then once the browser had loaded the applet, and it had started running, it would have continued to run even if we left the page. That would have hogged system resources, and could eventually have led to the browser locking up or crashing. Not very clever.

A much better way of handling things is to create a new Thread for doing the display-update endless loop. This thread can be destroyed by the stop() method, and a new one created by the start() method. The code also looks a lot better: init() only does initialisation, run() does all the work, start() starts things up and stop() stops them. It really does all make sense!