问题
What is the standard when coding in Java, when do you use camel case when do you use underscores etc.
回答1:
You stick with the Java Code Conventions.
What exactly the standard is doesn't matter - what matters is that everyone follows it, and you should too.
回答2:
ClassName
- Renderer
- HttpSession
methodName
- applyTo()
- run()
instanceVariable / localVariable
- currentUser
- threadList
CONSTANT_NAME
- LOG
- DEFAULT_CONTEXT
G (Generic Type Parameter)
- T
- E
回答3:
See Sun's Code Conventions for the Java(TM) Programming Language.
来源:https://stackoverflow.com/questions/2082729/to-camelcase-or-not-to-camel-case