哪里错了,我改。。。
package zh.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 {
Thread thread1=new Thread();
Thread thread2=new Thread();
Thread thread3=new Thread();
Thread thread4=new Thread();
Thread thread5=new Thread();
threads.add(thread1);
threads.add(thread2);
threads.add(thread3);
threads.add(thread4);
threads.add(thread5);
}
public static void main(String[] args) {
}
public static class Thread1 extends Thread{
public void run(){
while (true){
}
}
}
public static class Thread2 extends Thread{
public void run(){
try {
Thread.sleep(1);
}catch (InterruptedException e){
System.out.println("InterruptedException");
}
}
}
public static class Thread3 extends Thread{
public void run(){
try {
Thread.sleep(500);
System.out.println("加油");
}catch (InterruptedException e){
}
}
}
public static class Thread4 extends Thread implements Message{
public static boolean aBoolean=false;
public void run(){
while (!aBoolean&&isAlive()){
showWarning();
}
}
@Override
public void showWarning() {
aBoolean=true;
}
}
public static class Thread5 extends Thread{
BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
public void run(){
int sum=0;
try {
String s=reader.readLine();
while (!reader.equals("N")){
int num=Integer.parseInt(reader.readLine());
sum+=num;
}
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(sum);
}
}
}