我经过资料的搜索, 以及个人实践, 建议采用PascalCase.
以下是我个人对Java命名的方方面面的总结:
Naming Convention
0) Project
单词首字母大写, 即PascalCase
BillSystem
170213_JQueryDemo //一般我会在项目名前加上日期,便于在文件系统中能按照时间排序.
1) Package:
全部小写
com.sina.is
edu.bdqn.u2
2) Class/Interface:
首字母大写, 每个单词的首字母都大写, 尽量避免缩写, 除非这些缩写用得比原始单词还广泛得多, 比如URL, HTTP.
StudentDao
StudentDaoImpl
StudentServlet
3) Methods:
service();
getsNo();
setAddress();
4) Variables:
simple and explicit, concise, correct, clear, camelCase.
datetime
unit
itemName