• 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
  • 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.  


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

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


  • 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.  


  • 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)
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!