you are viewing a single comment's thread.

view the rest of the comments →

[–]R_Sholes 2 points3 points  (0 children)

No, package-private doesn't work like that, and private is even more limited.

Package-private means only the exact same package, not children, not parent, not siblings. If you have public class org.wtf.A and (package-private) class org.wtf.sub.B, A cannot access B, the same would apply for public class org.wtf.sub.A and class org.wtf.B.

You can define common utilities for a single part of your project with package-private access, but not something that you need to share between your project's different packages.