java包名为什么要小写? [英] Why should java package name be lowercase?

查看:15
本文介绍了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.

这篇关于java包名为什么要小写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆