Remix.run Logo
rob74 a day ago

Yup... if you're familiar with the old class-based approach, the new style raises more questions than it answers. Did they really turn "everything-is-an-object"-Java into a procedural language? What do you do if you do need command line arguments? Etc.

(I somehow mostly avoided learning Java, and my last passing contact with it was 20+ years ago, so these are honest questions).

js2 a day ago | parent | next [-]

The class is still there, implicitly.

The main function can be written with `String[] args` if you need it.

This is a decent summary of the changes:

https://www.happycoders.eu/java/main-method/

Further details:

https://openjdk.org/jeps/512

xiphias2 21 hours ago | parent | next [-]

,,Since an implicitly declared class cannot be accessed from outside, it must always contain a main method.’’

This looks like a hack just for the main file, it would have been good if these functions can be called from other files.

AstralStorm 21 hours ago | parent | prev [-]

And now to know what it does you have to read a book.

The IO class is good. The rest is information hiding. Now if you could write anything else in Java in this form,it would make sense.

bilekas a day ago | parent | prev [-]

If it's anything like dotnets change the void params are still a valid input.