lr12 -> e2-6
This commit is contained in:
25
lr12/e2.java
Normal file
25
lr12/e2.java
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user