Java naming convention with acronyms [duplicate]

ⅰ亾dé卋堺 提交于 2019-12-06 05:51:27

问题


Possible Duplicate:
Java Naming Convention with Acronyms

Is it getXml() or getXML()? Is there any official Sun/Oracle document on this?


回答1:


Both are correct. Use your preferred way, and be consistent with it throughout your code.




回答2:


You'll find both in the Java Standard API, so if there is a convention, it's not being widely followed.




回答3:


Not specified

Except for variables, all instance, class, and class constants are in mixed case with a lowercase first letter. Internal words start with capital letters. Variable names should not start with underscore _ or dollar sign $ characters, even though both are allowed.



来源:https://stackoverflow.com/questions/5704737/java-naming-convention-with-acronyms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!