August 05, 2004

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
 double lenght=Math.sqrt(Math.pow(x,20),Math.pow(y,20));(if too long)
 double length=Math.sqrt(Math.pow(x,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

- No comments Not publicly viewable

Add a comment

You are not allowed to comment on this entry as it has restricted commenting permissions.

Search this blog

Search Warwick Blogs



Most recent comments

  • Oracle 11g is the clear leader in this area. Oracle has invested heavily into self–tuning capabiliti… by shaane on this entry
  • All the features are very nice.I like Repair Advisors the most.Oracle 10G introduced some of the dat… by lucy on this entry
  • "logical standby failed to re–start, I am also getting the same error. I have search on internet and… by anemia on this entry
  • Thanks for the nice information because from last three days i am stuck on this problem…. by robot vacuum on this entry
  • So what happen City speed dating when you tried this coding once in your PC.. Please tell me so i am… by John Bergeron on this entry
Not signed in
Sign in

Powered by BlogBuilder