I don't understand
package pl.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 Watek1());
threads.add(new Watek2());
threads.add(new Watek3());
threads.add(new Watek4());
threads.add(new Watek5());
}
public static void main(String[] args) {
}
public static class Watek1 extends Thread {
@Override
public void run() {
while(true){}
}
}
public static class Watek2 extends Thread {
@Override
public void run() {
try{
Thread.sleep(10);
}catch (InterruptedException e){
System.out.print("InterruptedException");
}
}
}
public static class Watek3 extends Thread {
@Override
public void run() {
try {
while (true) {
System.out.println("Hurra");
Thread.sleep(500);
}
} catch (InterruptedException e) {}
}
}
public static class Watek4 extends Thread implements Message {
private boolean isAlive = true;
@Override
public void run() {
while(isAlive) {}
}
@Override
public void showWarning() {
isAlive = false;
}
}
public static class Watek5 extends Thread {
volatile BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
long suma;
String line;
int number;
@Override
public void run() {
while(!line.equals("N")) {
try {
line = reader.readLine();
} catch (IOException e) {
// e.printStackTrace();
} try {
if(isNumber(line))
number = Integer.parseInt(line);
else number = 0;
} catch ( NumberFormatException e) {
// e.printStackTrace();
}
suma += number;
}
System.out.println(suma);
}
public Boolean isNumber(String s){
for(int i = 0; i<s.length(); i++ )
if(!(s.charAt(i) >= 48 && s.charAt(i) <= 57))
return false;
return true;
}
}
}