Skip to content

Instantly share code, notes, and snippets.

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();
}