lr12 -> e2-6

This commit is contained in:
2026-04-11 18:58:43 +05:00
parent 661d20744a
commit 7310b240fd
5 changed files with 105 additions and 0 deletions

25
lr12/e2.java Normal file
View File

@@ -0,0 +1,25 @@
package lr12;
public class e2 {
public static void main(String[] args) {
Thread t1 = new Thread(() -> {
for (int i = 1; i <= 10; i++) {
System.out.println(i);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
});
t1.start();
try {
t1.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}