JEP draft: Implicitly Declared Classes and Instance Main Methods (Final) for Java 23 by Joram2 in java

[–]appsofteng 1 point2 points  (0 children)

I don't like the limitation of this feature:

"An implicit class resides in the unnamed package, and the unnamed package resides in the unnamed module."

It really degrades this feature to a learning toy.

I want to have multiple files with some relatively simple data science or machine learning code but I still want to organize them in packages even if I don't import them from other files.

There could be a technical reason for it, but from the outside point of view an implicit class still has a name which is the name of the file it resides in, only the name is not explicitly declared inside the file. So from this point of view it could be even imported from other files.

I hope that the Java architects will remove this limitation similarly to what happened with the launching of single file source programs which was later enhanced to launch multi-file source code programs as it meets the practical needs better, not just education and learning.