Can a JAVA program run without main method()? If not solve this problem..
This piece of code runs without a main method() can anyone explain me how could it happen.
class EndNow
{
publicvoid p()
{
System.out.println("It also........");
}
}
class MainLess
{
static
{
System.out.println("hi it worked ");
EndNow e =new EndNow();
e.p();
System.exit(0);
}
}
Thanks in advance

