complete code

This commit is contained in:
2026-05-25 21:22:34 +03:30
parent 067aae2ee6
commit 8d27896aa6
9 changed files with 118 additions and 15 deletions
@@ -1,4 +1,19 @@
package lecture.multithreading.timeout;
public class MyRunnable {
public class MyRunnable implements Runnable{
@Override
public void run() {
for(int i = 1 ; i <= 10 ; i++){
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
System.out.println("thread was interrupted");
}
if(i == 10) {
System.out.println("time is up. ");
System.exit(0);
}
}
}
}