Variable name for getters

February 28, 2007 · Posted in java 

It’s NOT the name of the member variable that counts, it’s the name of the get method.

You use the part after “get” as the property name.

Normally you would convert the first letter after “get” to lowercase, but if the second letter is uppercase also, then you don’t.

getXYAxis – the variable name should be “XYAxis”

getName – the variable name should be “name”

Comments

Leave a Reply