вроде даже потоки не запускал, чего крутится...
55 строки нет, это все расторопные обновления/синхронизация/или как оно там работает
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
{
Thread t1 = new Thread1();
threads.add(t1);
Thread t2 = new Thread2();
threads.add(t2);
Thread t3 = new Thread3();
threads.add(t3);
Thread t4 = new Thread4();
threads.add(t4);
Thread t5 = new Thread5();
threads.add(t5);
}
public static void main(String[] args) {
}
public static class Thread1 extends Thread{
public void run()
{
while(!isInterrupted())
{
}
}
}
public static class Thread2 extends Thread{
public void run()
{
while(!isInterrupted())
{
try {
}catch(Exception e){
System.out.println("InterruptedException");
}
}
}
}
public static class Thread3 extends Thread{
public void run()
{
while(!isInterrupted())
{
System.out.println("Ура!");
try {
sleep(500);
}catch(Exception e){
e.printStackTrace();
}
}
}
}
public static class Thread4 extends Thread implements Message{
public void run()
{
while(!isInterrupted())
{
System.out.println("Ура!");
try {
sleep(500);
}catch(Exception e){
e.printStackTrace();
}
}
}
@Override
public void showWarning() {
interrupt();
}
}
public static class Thread5 extends Thread{
public void run()
{
int i = 0;
String line = "";
while(!isInterrupted())
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try {
i += Integer.parseInt(reader.readLine());
}catch(Exception e){
if("N".equals(line))
{
System.out.println(i);
break;
}
}
}
}
}
}