Input
Output
public class Joinmethod extends Thread{ public void run(){ try{ for(int i=1;i<=5;i++){ System.out.println(i); Thread.sleep(700); } }catch(InterruptedException e){ System.out.println(e); } } public static void main(String args[]){ Joinmethod t1=new Joinmethod(); Joinmethod t2=new Joinmethod(); Joinmethod t3=new Joinmethod(); t1.start(); System.out.println("Thread One is alive: "+ t1.isAlive()); try{ t1.join(); }catch(InterruptedException e){ System.out.println(e); } t2.start(); t3.start(); } }