The Element of Java Style
1. Do not try to short the name by removing vowels.using Message instead of Msg
using appendSignature instead of appndSgntr and Captitalize only the first letter in acronyms. i.e. change loadXMLDocument() to loadXmlDocument()2. using the following format for java doc comment.
/** * */ use
tell HTML browser to render content in different style.
"" tell HTML browser retain the original format.
3.use block synchronization instead of method sychornization if possible.
4.varible and method name start with low case.
5.use uppercase letter for each word and separate each pair of words with an underscore when naming constnats: MAX_VALUE
6.break
double lenght=Math.sqrt(Math.pow(x,20),Math.pow(y,20));(if too long)
into
double length=Math.sqrt(Math.pow(x,20),
Math.pow(y,20))
and do like the following:
return this==object || (this.obj instance of MyClass && this.field== obj.field);7.using equals , not == to test the equality of objects.
8.For Comment elemnt,
for class,method, field you have @Description @see @since @deprecated all.
for class, you also have @author @version
for method, you also have @param @return @exception
Add a comment
You are not allowed to comment on this entry as it has restricted commenting permissions.