public class HelloWorld {
String str = "Hello,World!"
public HelloWorld()
{
  System.out.println(str);
}
public static void main(String[] args) {
new HelloWorld();
}}错误:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:  at HelloWorld.main(.....)

解决方案 »

  1.   

    我认为这么改一下就可以了:
    public class HelloWorld 
            {
    String str = "Hello,World!";
    public void HelloWorld()
    {
    System.out.println(str);
    }
    public static void main(String[] args) {
    HelloWorld aa= new HelloWorld();
            aa.HelloWorld();
    }
    }
      

  2.   

    同意楼上的,你的HelloWorld函数没有返回类型啊,没有的话要写void的
      

  3.   

    这个我是直接用HelloWorld改的 
    是不是编译的问题。我改了还是不行