создал значиться чисто по приколу колесницу из отходов огня и чей-то матери как думаете может ли это при допиливании пройти это задание
package com.javarush.task.task16.task1632;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/*
Клубок
*/
public class Solution {
public static List<Thread> threads = new ArrayList<>(5);
public static void main(String[] args) {
threads.add(new Thread(() -> {
while (true) {
}
}));
threads.add(new Thread(() -> {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
System.out.println("InterruptedException");
}
}));
threads.add(new Thread(() -> {
try {
for (int i = 0; i < 20; i++) {
Thread.sleep(500);
System.out.println("Ура");
}
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}));
threads.add(new Thread4());
threads.add(new Thread(() -> {
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in))) {
int sum = 0;
ArrayList<Integer> arrayList = new ArrayList<>();
String s = bufferedReader.readLine();
if (!s.equals("N")) {
arrayList.add(Integer.valueOf(s));
} else {
for (int a : arrayList) {
sum += a;
}
System.out.println(sum);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}));
for (int i = 0; i < threads.size(); i++) {
threads.get(i).start();
}
}
public static class Thread4 extends Thread implements Runnable, Message {
@Override
public void showWarning() {
Thread.interrupted();
}
@Override
public void run() {
showWarning();
}
}
}