Is there any other way of creating a program without a main method ?
public class Test{
static{
System.out.println("Without a Main Method");
System.exit(1);
Depends on what your definition of "program" is. What you posted would not fit my definition of "program", but it is a Java class that can be executed without having a main method, yet still executes some code.