// isalive.java class CustomThread3 extends Thread { CustomThread3(String name) { super(name); start(); } public void run() { try { for(int loop_index = 0; loop_index < 4; loop_index++) { System.out.println( (Thread. currentThread()).getName() + " thread here..."); Thread.sleep(1000); } } catch (InterruptedException e) {} System.out.println( (Thread.currentThread()).getName() + " ending."); } } class isalive { public static void main(String args[]) { CustomThread3 thread1 = new CustomThread3("first"); CustomThread3 thread2 = new CustomThread3("second"); CustomThread3 thread3 = new CustomThread3("third"); CustomThread3 thread4 = new CustomThread3("fourth"); System.out.println(thread1.isAlive()); try { thread1.join(); thread2.join(); thread3.join(); thread3.join(); } catch (InterruptedException e) {} System.out.println(thread1.isAlive()); } }