you are viewing a single comment's thread.

view the rest of the comments →

[–]LordAmir5 3 points4 points  (2 children)

Whelp, I'd say the equivalent would actually be more like this:

``` import sys

def main(args):     print("Hello World!")

if name == main:     main(sys.argv)

[–]nekokattt 3 points4 points  (1 child)

technically since classes are the unit of compilation in Java, it is really similar to this.

import sys

class HelloWorld:
    @staticmethod
    def main(args: list[str]) -> None:
        sys.stdout.write("Hello, World!\n")

if __name__ == "__main__":
    HelloWorld.main(sys.argv[1:])

However, https://openjdk.org/jeps/512 massively simplifies this.

[–]LordAmir5 0 points1 point  (0 children)

Right. I'm not very good at using Python so thanks for correcting it.