/*
 * This File is one of the examples from Java Application Development
 * Do not reproduce this code for others or use it in a commercial setting without prior permission from the author.
 */

package tasks;

/**
 *
 * @author Matthew Gregory
 * @website www.matthewgregory-author.com.au
 *
 */
public class SharedTask implements Runnable {
    
    private int i;//define counter here so it is 'shared'
    
    public void run() {
        for (i=1;i<=100;i++){//Note: we are using the 'shared' variable
            System.out.println("Number: "+i
                               +" Processed by: "
                               +Thread.currentThread().getName());
            TakeABreak.sleep();
        } 
    }
}
