To camelCase or not to camel_case

前端 未结 3 1294
广开言路
广开言路 2021-02-05 15:27

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

相关标签:
3条回答
  • 2021-02-05 15:46

    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.

    0 讨论(0)
  • 2021-02-05 16:02

    ClassName

    • Renderer
    • HttpSession

    methodName

    • applyTo()
    • run()

    instanceVariable / localVariable

    • currentUser
    • threadList

    CONSTANT_NAME

    • LOG
    • DEFAULT_CONTEXT

    G (Generic Type Parameter)

    • T
    • E
    0 讨论(0)
  • 2021-02-05 16:05

    See Sun's Code Conventions for the Java(TM) Programming Language.

    0 讨论(0)
提交回复
热议问题