Zandis Murāns wrote:This is not possible at all.
Well, as you can see in the examples in this post, it
is possible.
For some reason people ask this question now and then on the forums here: "how can I write a program that runs without a main() method", etc. I wonder why so many people are asking this (is there someone or some company who asks this to people as a trick question for job interviews?).
Anyway, it's an interesting but practically useless trick, I suggest you forget it immediately and never use it in any real program.