Is the Main method must needed in a Java program?
<p>Is the main method needed to write a java program?</p>

<p>This is my code:</p>

<pre><code>package example;

public class HelloWorld {

    public HelloWorld() {

    }

    public String getHelloWorld() {

        return "Hello From Java!";
    }
}
</code></pre>

<p>It shows an error at compilation:</p>

<pre><code>java.lang.NoSuchMethodError: main
Exception in thread "main"
</code></pre>
