public static void main(String[] args) {
ExecutorService e = Executors.newCachedThreadPool();
e.execute(new test1());
}
class test1 implements Runnable{
public void run(){
System.out.println(“毛二狗”);
}
}
在class 前加个static就可以了
public static void main(String[] args) {
ExecutorService e = Executors.newCachedThreadPool();
e.execute(new test1());
}
class test1 implements Runnable{
public void run(){
System.out.println(“毛二狗”);
}
}
在class 前加个static就可以了