11th&12th(1)
11th&12th(1)
// The run method that will be executed when the thread starts
@O verride
public void run() {
for (int i = 1; i <= 5; i++) {
System.out.println(Thread.currentThread().getName() + " Count:
" + i);
try {
Thread.sleep(50 0 ); // Sleep for 50 0 milliseconds
} catch (InterruptedException e) {
System.out.println(Thread.currentThread().getName() + "
Thread interrupted.");
}
}
}
}