I was asked this question in an interview.
How to print message on console without using main() method?
main()
In a file called A.java
A.java
class Con { String hi = "\n\nHello World\n\n"; }
You just have to compile the program on Windows. Not run it. :-P