проверял разными способами, где ошибка ? 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; import java.util.Scanner; /* Клубок */ public class Solution { public static List<Thread> threads = new ArrayList<>(5); static { MessageStop numbersSum = new MessageStop(); numbersSum.start(); numbersSum.showWarning(); try { Thread.sleep(1000); } catch (InterruptedException e) { throw new RuntimeException(e); } System.out.println(numbersSum.isAlive()); threads.add(new Infinity()); threads.add(new Exception()); threads.add(new Ura()); threads.add(new MessageStop()); threads.add(new NumbersSum()); } public static void main(String[] args) { } public static class Infinity extends Thread { @Override public void run() { while (true) { super.run(); } } } public static class Exception extends Thread { public void run() { try { throw new InterruptedException(); } catch (InterruptedException e) { System.out.println("InterruptedException"); } } } public static class Ura extends Thread { public void run() { while (true) { System.out.println("Ура"); try { Thread.sleep(500); } catch (InterruptedException e) { throw new RuntimeException(e); } } } } public static class MessageStop extends Thread implements Message { @Override public void showWarning() { this.interrupted(); } @Override public void run() { while (!isInterrupted()) { } } } public static class NumbersSum extends Thread { @Override public void run() { int sum = 0; while (true) { Scanner scanner = new Scanner(System.in); String volume = scanner.nextLine(); if (volume.equals("N")) { System.out.print(sum); break; } else { try { sum += Integer.parseInt(volume); } catch (NumberFormatException e) { volume = scanner.nextLine(); } } } } } }