4

Possible Duplicate:
Java Naming Convention with Acronyms

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

Community
  • 1
  • 1
Michael
  • 13,838
  • 18
  • 52
  • 81
  • Related: http://stackoverflow.com/questions/1699944/what-is-correct-java-naming-convention-for-id – Henning Apr 18 '11 at 15:02

3 Answers3

4

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

Michael Borgwardt
  • 342,105
  • 78
  • 482
  • 720
  • Yeah that's why I wanted to see if there's some 'official' convention. I find it quite annoying, but perhaps I'm just being too pedantic. – Michael Apr 18 '11 at 15:04
3

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

mdrg
  • 3,242
  • 2
  • 22
  • 44
2

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.

Vladimir Dyuzhev
  • 18,130
  • 10
  • 48
  • 62