class TicketsThread extends Thread{
int tickets = 100;
public void run(){
while(true){
if(tickets == 0)
break;
System.out.println(Thread.currentThread().getName()+"ticktes:"+tickets--);
}
}
}class Two{
public static void man(String[] args){
TicketsThread tt = new TicketsThread();
tt.start();
}
}为什么会出现异常??
Exception in thread "main" java.lang.NoSuchMethodError: main
int tickets = 100;
public void run(){
while(true){
if(tickets == 0)
break;
System.out.println(Thread.currentThread().getName()+"ticktes:"+tickets--);
}
}
}class Two{
public static void man(String[] args){
TicketsThread tt = new TicketsThread();
tt.start();
}
}为什么会出现异常??
Exception in thread "main" java.lang.NoSuchMethodError: main
public static void man(String[] args){
TicketsThread tt = new TicketsThread();
tt.start();晕看你的主子函数、、、 main()
还有,执行的时候要执行Two