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(.....)
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(.....)
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();
}
}
是不是编译的问题。我改了还是不行