CMPE 261 - Lab worksheet - Week 9

Problem : Multi-threaded timing application

Write a program which prints texts "tik" and "tak" at terminal intermittently every second. Your program must contain a Runnable Ticker class, and the main thread creates two additional threads, each running an instance of Ticker.

The following class structure is recommended for Ticker, which takes initial delay, period, and the message to display:

    /** Starts after initialDelay milliseconds and prints message on terminal every period milliseconds */
    class Ticker {
        ...
        Ticker(long initialDelay, long period, String message) {
        ...
        }
        ...
    }