public class TestThreadOutput {
public static void main(String[] args) {
OutputInt opi=new OutputInt();
Thread th1=new Thread(opi);
Thread th2=new Thread(opi);
th1.start();
th2.start();
}
}
class OutputInt implements Runnable{
public void run() {
for(int i=10;i<=15;i++){
System.out.print(i+",");
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}