Win a copy of Terraform in Action this week in the Cloud forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

    [autolink: NamingConventions]
     
    You showed up just in time for the waffles! And this tiny ad:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
      Bookmark Topic Watch Topic
    • New Topic