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