Topic: Exception in thread "main" java.lang.NoSuchMethodError: main

  Print this page

1.Exception in thread "main" java.lang.NoSuchMethodError: main Copy to clipboard
Posted by: aiff
Posted on: 2004-10-12 15:08

class dd
{
  
int age;
  void shout()
  {
    int age=90;
    System.out.print("oh,my god"+age);
  }
  }
输入没有答案...............

2.Re:Exception in thread "main" java.lang.NoSuchMethodError: main [Re: aiff] Copy to clipboard
Posted by: aiff
Posted on: 2004-10-12 15:28

有人说感觉在看C++

3.Re:Exception in thread "main" java.lang.NoSuchMethodError: main [Re: aiff] Copy to clipboard
Posted by: westwin
Posted on: 2004-10-12 17:17

xd,你的Class里没有定义main函数,是不能执行的,所谓main函数即程序的入口...

4.Re:Exception in thread "main" java.lang.NoSuchMethodError: main [Re: aiff] Copy to clipboard
Posted by: aiff
Posted on: 2004-10-12 18:22

有人这样说 她说得对吗?

这样做,JAVA会报错,JAVA中不允许这样在变量的作用域中再重新定义变量的,这样容易引起混淆
本来方法的重载就够程序员烦的了

5.Re:Exception in thread "main" java.lang.NoSuchMethodError: main [Re: aiff] Copy to clipboard
Posted by: cjyzpcl
Posted on: 2004-10-12 19:36

不对,这样做是可以的。只是因为没有相应得main方法,所以无法执行程序!


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923