Thursday, January 13, 2011

Naming Conventions

java language fallow the naming conventions. Some of the naming conventions


  • package names in java are written in all small letters ex: java.lang, java.io etc

  • each word of the class and interface names start with a capital ex: String, DataInputStream etc

  • method names start with a small letter then each word start with a capital ex: println(), readLine(),getNumberInstance() etc

  • variables names start with a small letter then each word start woth a capital ex: age, empName etc

  • constants should be written using all capitals ex: PI, MAX_VALUE etc

  • all keywords should be written in all small letters ex: public,void, import, static etc

No comments:

Post a Comment