• 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
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger
  • 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.

    [autolink: NamingConventions]
    Check your pockets for water buffalo. You might need to use this tiny ad until locate a water buffalo:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
      Bookmark Topic Watch Topic
    • New Topic