Java-Modules-JPMS-CheatSheet icon indicating copy to clipboard operation
Java-Modules-JPMS-CheatSheet copied to clipboard

[Question] Modules vs Private

Open jzy3d opened this issue 4 years ago • 0 comments

Thanks for your cheatsheet!

You say that "In pre-Java 9 world any public class was available everywhere and could be used by any other class". Preventing access to a class is often cited as one of the advantages of Java 9 modules. Do you know why the existingprivate keyword is not enough when willing to prevent usage of a class?

Beside this I often wonder why one would want to hide code in a world where 99% of dependencies come from open source projects!

jzy3d avatar Oct 11 '21 05:10 jzy3d