        // Illustrate the creation and running of a simple thread.
public class ThreadExample {
    public static void main(String[] args){
        ThreadCounter secondThread = new ThreadCounter();

        if(!secondThread.isAlive()){
            System.out.println("Second thread is not yet alive.");
        }
        secondThread.start();
        if(secondThread.isAlive()){
            System.out.println("Second thread is now alive.");
        }
        // Let secondThread have a go.
        Thread.yield();
        if(!secondThread.isAlive()){
            System.out.println("Second thread is no longer alive.");
        }
        System.out.println("First thread has finished.");
    }
}
