public class Processing{
Thread tempTH = new Thread(new Runnable() {
public void run(){
int counter = 0;
while(counter <= 10){
try {
System.out.println(counter++);
Thread.sleep(1000);
}
catch (InterruptedException ex) {
System.out.println(ex);
}
}
}
});
} |