public class lab30 implements Runnable { public void run() { for(int i=0;i<5;i++) { try { Thread.sleep(500); System.out.println(i); } catch(InterruptedException e) { System.out.println(e); } } } public static void main(String[] args) { lab30 obj=new lab30(); Thread obj2= new Thread(); obj2.start(); } }