java包名为什么要小写?

其实这完全是理论上的问题.但有趣的是为什么 java 规范不允许在包中使用大写字母并导致写这样的东西:

Actually this is completely theoretic question. But it's interesting why java specification don't allow uppercase characters letters in package and cause write something like this:

com.mycompany.projname.core.remotefilesystemsynchronization.*

而不是

com.myCompanyName.projName.core.remoteFileSystemSynchronization.*

推荐答案

直接来自 Oracle 文档

包名全部小写以避免与类或接口的名称.

Package names are written in all lower case to avoid conflict with the names of classes or interfaces.

相关文章