Is the main method needed to write a java program?
This is my code:
package example;
public class HelloWorld {
public HelloWorld() {
}
public String getHelloWorld() {
return "Hello From Java!";
}
}
It shows an error at compilation:
java.lang.NoSuchMethodError: main
Exception in thread "main"