Possible Duplicate:
Exception in thread 「main」 java.lang.NoSuchMethodError: main異常在線程「主」 java.lang.NoSuchMethodError:主
public class m
{
int a; //class variable
void f1()
{
int b=10;
System.out.println(a);
System.out.println(b);
}
}
class B
{
public static void main(String args[])
{
m ob=new m(); //object created
ob.f1(); //calling f1 method
}
}
嗨,歡迎在Stackoverflow。我們將不勝感激,如果您在未來的智能方式上提出更多的努力*) – BalusC 2010-06-04 02:18:30
此社區Wiki問題列出了此常見問題的可能原因:http://stackoverflow.com/questions/5407250/原因-java-lang-nosuchmethoderror-main-exception-in-thread-main – 2011-06-28 14:37:54