All pastes #475250 Raw Edit

Anonymous

public java v1 · immutable
·published 2007-05-07 10:25 UTC
rendered paste body
import java.util.*;public class SecondTester implements Runnable {    private Timer secondTimer;    private int secondCounter;    private boolean switcher = false;    public boolean simRunner = true;    private int count = 0;        public SecondTester()    {        secondTimer = new Timer();    }    public void run()     {        System.out.println("Hello from another thread!");        SecondTester sT = new SecondTester();        secondTimer.schedule(new secondTimer(), 0, 500);    }            class secondTimer extends TimerTask    {        public void run()        {            if (simRunner == true)            {                   for (int i=0; i< 100; i++)                {                    System.out.println();                }                                    if (switcher == false)                {                    System.out.println("'o.");                    System.out.println(".o'");                    System.out.println("'o.");                    System.out.println(".o'");                    System.out.println("'o.");                    System.out.println(".o'");                    switcher = true;                    System.out.println("Press enter!");                }                else if (switcher == true)                {                 System.out.println(".o'");                 System.out.println("'o.");                 System.out.println(".o'");                 System.out.println("'o.");                 System.out.println(".o'");                 System.out.println("'o.");                 switcher = false;                 System.out.println("Press enter!");               }            }               count++;               if (count == 20)               {                   System.exit(0);                }    }    }        public static void main(String args[]) {            }        public void runnerFalse()    {        simRunner = false;    }}