This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification 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 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
This page was migrated from a javaranch.com.jsp


   
   
     
     Java Programming Style Guide
   
 






2 - Identifiers

All identifiers use letters ('A' through 'Z' and 'a' through 'z') and numbers ('0'
through '9') only. No underscores, dollar signs or non-ascii characters.



Hungarian Notation violates OO abstraction and is not to be used.







2.1 - Classes and Interfaces

All class and interface identifiers will use mixed case. The first letter of each word
in the name will be uppercase, including the first letter of the name. All other letters
will be in lowercase, except in the case of an acronym, which will be all upper case.



Examples:


     

    Customer

     SalesOrder

     TargetURL

     URLTarget

     








2.2 - Packages

Package names will use lower case characters only. Try to keep the length under eight
(8) characters. Multi-word package names should be avoided.



Examples:


     

    common

     core

     lang

     








2.3 - All Other Identifiers

All other identifiers, including (but not limited to) attributes, variables, methods
and parameters will use this default naming convention. This includes final identifiers
(using all upper case, as traditionally done in C, is a violation of OO abstraction). The
first letter of each word in the name will be uppercase, except for the first letter of
the name. All other letters will be in lowercase, except in the case of an embedded
acronym, which will be all uppercase. Leading acronyms are all lower case.



Examples:


     

    customer

     salesOrder

     targetURL

     urlTarget

     



 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like 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!