Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
> > I am learning Java. Are there any standard naming conventions in Java which I should be using for my own benefit and for the benefit of other people reading/debugging my code? > > Thanks, Very definite naming conventions especially when it comes to javaBeans. Most books on java cover them. You may want to download Tbinking in Java by Bruce Eckel at bruceeckel.com it is well worth the effort. as for some of the conventions commonly accepted that are not required by beans: packages are all lower case classes begin with a capital letter. methods begin with a lower case letter and each word after is getxxxx and setxxxx are generally accepted as access methods to private variables, and are generally used even within the class. constants are all caps. member variables are generally prefaced with m_xxx USE LONG NAMES such as departmentNumber = not dpnm or depnum or some such Remember, java is totally case sensitive. All conventions are just that, conventions and not rules. A little time under your belt reading other code will make all conventions obvious, both naming conventions and coding conventions.
Replies: |
Sponsored Links
|