Paul Clapham wrote:
You mean that java.exe should create an object of the X class and then call that object's main(String[]) method?
Then there would have to be some rules which allowed java.exe to create an object of the X class. You'd have to make a rule that every class to be executed via main(String[]) would also have to have a zero-argument constructor, so that java.exe would be able to create an object. Or something like that.
That seems like an unnecessary complication to me. Sure, they could have done that. But why would they?
Ulf Dittmer wrote:What is "the program" if the JVM is started through the "java" command (which is not implemented in Java)? How would it get hold of an appropriate object?