按你说的改过之后,提示为“Exception in Thread "main" java.lang.NoClassDefFoundError:helloworld<wrong name:test/helloworld>”

解决方案 »

  1.   

    源程序在这:
    package test;
    public class helloworld {
    {
    System.out.println("Hello");
    }
    }运行时:
    javac helloworld.java
    java helloworld
      

  2.   

    set classpath=.;%classpath%java test.helloworld
      

  3.   

    no main function. ft!
    static void main() {}
      

  4.   

    我只是想生成一个类,用的着main()吗,如果要加的话加在那?
      

  5.   

    在程序的开头和最后都可以
    public class helloworld {
      public static viod main(String args[])
      {
        System.out.println("hello world");
      }
    }
      

  6.   

    沒有main函數
    程序當然跑不起來了