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

解决方案 »

  1.   

    public static void man(String[] args){ 写错了 应该是main
      

  2.   

    Exception in thread "main" java.lang.NoSuchMethodError: main直接翻译就是: 没有这个方法错误:main
      

  3.   

    class Two{
    public static void man(String[] args){ 
    TicketsThread tt = new TicketsThread();
    tt.start();晕看你的主子函数、、、 main()
      

  4.   

    没错.
    还有,执行的时候要执行Two