View RSS Feed

Java Object

Naming a Method

Rate this Entry
by , 04-26-2012 at 05:14 PM (450 Views)
Though a method name could be code conventions or legal identifier restrict method names. Method names shall be multi worded name which will be starting with verb, in lowercase preceeded by nouns, adjectives etc or they shall be verb, in lowercase. In case of multi word names, it is necessary that 1st letter of every second & preceeding words shall be made capital. Few examples are as following:

run
runFast
getBackground
getFinalData
compareTo
setX
isEmpty

Method consists of a unique name typically in its own class, method may be having similar name just like other methods because of the method overloading.

Submit "Naming a Method" to Facebook Submit "Naming a Method" to Digg Submit "Naming a Method" to del.icio.us Submit "Naming a Method" to StumbleUpon Submit "Naming a Method" to Google

Categories
Tutorial

Comments