• Post Reply Bookmark Topic Watch Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are the naming conventions to be used when coding in Java:

  • For variable and method names, use camelCase.

  • This naming style starts with a lowercase letter and uses an uppercase letter for each word after that.  

       thisIsAnExample

  • For class, interface, and enum names, and constructors, use PascalCase.

  • This naming style uses an uppercase letter for each word, including the first letter.  

       ThisIsAnExample

  • For constants (that is, fields that are static final) and enum fields, use SNAKE_CASE1.

  • This naming convention uses all uppercase letters and underscores to separate words.  

       THIS_IS_AN_EXAMPLE

  • For package names, each component should be made up of only lowercase letters and numbers, not hyphen or underscores.  Each component is separated by a dot.

  •    this.is.anexample

    Below is a sample program that demonstrates most of the naming conventions:

    1 Technically, snake case can contain lowercase letters, but this is not the Java convention.
     
    Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
    Java file APIs (DOC, XLS, PDF, and many more)
    https://products.aspose.com/total/java
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!