This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) throws InterruptedException { | |
int i = 0; | |
while (i < 100) { | |
Thread t1 = new Thread(() -> System.out.print("a")); | |
Thread t2 = new Thread(() -> { | |
try { | |
t1.join(); | |
} catch (InterruptedException e) { | |
e.printStackTrace(); | |
} |