If I have a property 'gId' in my Java class what should the accessor method be named as?
getGId
is what I assume.
If there were a property gURL
I think it would be getGURL
, which kind of looks ugly (not referring to the alternative spelling of girl though).
If the property was just url
the method name getUrl
is good on the eye and yeah I would not name the property as URL in the first place which would make the accessor ugly again - getURL
I remember reading from the Javabean Specification PDF somewhere about capitalization of properties and also cases involving acronyms but cant find it in the PDF anymore.
Does anyone have a reference to it or please confirm if I am right in what I am saying?
See Question&Answers more detail:os