Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

To camelCase or not to camel_case

What is the standard when coding in Java, when do you use camel case when do you use underscores etc.

like image 384
Aly Avatar asked Jan 17 '10 21:01

Aly


2 Answers

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.

like image 123
Anon. Avatar answered Nov 03 '22 01:11

Anon.


ClassName

  • Renderer
  • HttpSession

methodName

  • applyTo()
  • run()

instanceVariable / localVariable

  • currentUser
  • threadList

CONSTANT_NAME

  • LOG
  • DEFAULT_CONTEXT

G (Generic Type Parameter)

  • T
  • E
like image 40
whiskeysierra Avatar answered Nov 03 '22 01:11

whiskeysierra