Removing excess whitespace, is this the shortest hello world program one can make in Java?
Or without throwing an error:Code:enum X { X; X() { System.out.print("Hello World!"); } }
Any thoughts? Just curious if anyone can devise a smaller version. (I came up with the enum version after seeing one using static initializers.)Code:enum X { X; X() { System.out.print("Hello World!"); System.exit(0); } }



Reply With Quote
Bookmarks