Доброе время суток, Немогу понять почему не проходит валидацию
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);
static {
threads.add(new Thread1());
threads.add(new Thread2());
threads.add(new Thread3());
threads.add(new Thread4());
threads.add(new Thread5());
}
public static void main(String[] args) {
}
public static class Thread1 extends Thread implements Runnable {
@Override
public void run() {
while (true) {
}
}
}
public static class Thread2 extends Thread implements Runnable {
@Override
public void run() {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
System.out.println("InterruptedException");
}
}
}
public static class Thread3 extends Thread implements Runnable {
@Override
public void run() {
while (true) {
try {
System.out.println("Ура");
Thread.sleep(500);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
public static class Thread4 extends Thread implements Runnable, Message {
@Override
public void run() {
while (!this.isInterrupted()) {
}
}
@Override
public void showWarning() {
this.interrupt();
}
}
public static class Thread5 extends Thread implements Runnable {
@Override
public void run() {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
while (this.isInterrupted()) {
int sum = 0;
String s;
try {
while (true) {
s = reader.readLine();
if (s == "N") break;
sum += Integer.parseInt(s);
} } catch (IOException e) {
e.printStackTrace();
}
System.out.println(sum);
this.interrupt();
}
}
}
}