is the Main method must needed in java Program?

Posted by Praveen Chandrasekaran on Stack Overflow See other posts from Stack Overflow or by Praveen Chandrasekaran
Published on 2010-05-24T10:46:17Z Indexed on 2010/05/24 10:51 UTC
Read the original article Hit count: 199

Filed under:

is the main method is must needed to write a java code.

this my code :

package example;
public class HelloWorld {

public HelloWorld() {

}

public String getHelloWorld() {

    return "Hello From Java!";

}
}

it shows error at compilation :

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

© Stack Overflow or respective owner

Related posts about java