Re:Java 22 Released
by bheadmaster on Tuesday March 19, 2024 @03:31PM
(#39759403)
Good that they got rid of the class/public static void/string[] Args boilerplate, but if they just went one step forward and declared implicit main function as top-level scope of a file, we could've got to a Python level of tersity. Just imagine!
[ Parent
| on HN ]
To be that guy, not quite a python level of tersity!
Re:Java 22 Released
by fuzztester on Wednesday March 20, 2024 @04:47PM
(#39771817)
# Python 3
p = print # the print() function
# Now we can do:
p("Hello world")
# endlessly, in this file.
Shorter by 17-odd characters than the above Java version.
Re:Java 22 Released
by bheadmaster on Thursday March 21, 2024 @10:06AM
(#39778671)
Well, if they added System.out in the default context, it could've been just
println("Hello world!")
I think that's as far as you can go.