Java examples for Thread:Thread Operation
Create a thread that extending the Thread class.
class CountDownClock extends Thread { public void run() {// ww w.j a va 2 s .c o m for (int t = 20; t >= 0; t--) { System.out.println("T minus " + t); try { Thread.sleep(1000); } catch (InterruptedException e) {} } } } public class Main { public static void main(String[] args) { Thread clock = new CountDownClock(); clock.start(); } }