class Abc { public static void main(String[] ar){ Mythread mt = new Mythread(); mt.start(); Mythread mt1 = new Mythread(); mt1.start(); } } class Mythread extends Thread{ public void run(){ for(int i = 0; i<= 9; i++){ System.out.println(Thread.currentThread().getId() + " " + i); } try{ Thread.sleep(1000); } catch(InterruptedException iex){ } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)