3 ms·
It's implicitly still a class, you just don't need to write all the scaffolding to indicate that. The functions are still methods of that class etc. But, yes,
by int_19h 2y ago
It's implicitly still a class, you just don't need to write all the scaffolding to indicate that. The functions are still methods of that class etc.
But, yes, with static imports, you can just write "println" like that and have it work.
- almostgotcaught 2y ago> It's implicitly still a class, you just don't need to write all the scaffolding to indicate that. did you know that every function in a python script is actually an attribute of that module (which is basically a class). so my point is: who cares.
- imtringued 2y agogeokon's point still stands. This is meaningless syntax sugar that does not change anything fundamental about Java except add one more special rule into the language aka it is one more thing to learn. Rather than being helpful, it just becomes friction when an old developer uses the old method and a new developer uses the new method. You still need to know what a main class is, so that you can reference it in your build.gradle file.
- losvedir 2y agoIf you're using a build.gradle file then you probably won't see any benefit to this implicit class, yes. But it's useful for little one-off scripts, where you just go `$ java foo.java` from the command line.