import java.io *;. import java.util *;. import java.text.SimpleDateFormat; public class TestThread extends Thread {private static Integer threadCounterLock; // for synchronization, data is written to prevent arbitrary private static int threadCount; // this thread class counter static {threadCount = 0; threadCounterLock = new Integer (0);} public TestThread () {super ();} public synchronized static void incThreadCount () {threadCount ; System.out.println ( "thread count after enter: " threadCount);} public synchronized static void decThreadCount () {threadCount--; System.out.println (" thread count after leave: " threadCount);} public void run () {synchronized (threadCounterLock) // Synchronization {ThreadCount ; System.out.Println ("Thread Count After ENTER: THREADCOUNT);} // inchetcount (); // and the above statement block is equivalent Final Long nsleepmillisecs = 1000; // cycle Sleep time long ncurrenttime = system.currenttime Millis (); long nEndTime = nCurrentTime 30000; // Run deadline SimpleDateFormat simpleDateFormat = new SimpleDateFormat ( "yyyy-MM-dd HH: mm: ss"); try {while (nCurrentTime