Can some please help out with fresh eyes?
package com.codegym.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) {
for (int h =0; h<5; h++){
threads.get(h).start();
}
}
public static class thread1 extends Thread {
public void run(){
while(true);
}
}
public static class thread2 extends Thread {
public void run(){
while(!interrupted());
System.out.println("InterruptedException");
}
}
public static class thread3 extends Thread{
public void run(){
while (true){
try{
System.out.println("Hurray");
Thread.sleep(500);
} catch (Exception e){}
}
}
}
public static class thread4 extends Thread{
public void run(){
while (!interrupted());
}
//@Override
public void showWarning(){
this.interrupt();
}
}
public static class thread5 extends Thread{
public void run(){
int num = 0;
String s = null;
while(true){
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
s = br.readLine();
if (s.equals("N")){
System.out.println(num);
break;
}else{
int n = Integer.parseInt(br.readLine());
num = num + n;
break;
}
}catch(Exception e){}
break;
}
}}
}