问题
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