Sun estimated that over the lifetime of a standard piece of code, 20 percent of the effort will go into the original creation and testing of the code, and 80 percent of the effort will go into the subsequent maintenance and enhancement of the code. Agreeing on, and coding to, a set of code standards helps to reduce the effort involved in testing, maintaining, and enhancing any piece of code. Sun had created a set of coding standards for Java, and published those standards in a document cleverly titled "Java Code Conventions," which you can find at
http://www.oracle.com/technetwork/java/codeconv-138413.html. It's a great document, short and easy to read and we recommend it highly. Here are the naming standardsthat Sun recommends, and that we use in the exam and in most of the book:
Classes and interfaces
Dog
Account
PrintWriter
For interfaces, the names should typically be adjectives like
Runnable
Serializable
Methods
getBalance
doCalculation
setCustomerName
Variables
buttonWidth
accountBalance
myString
Constants
MIN_HEIGHT