3

I have a boolean field called showLabels in a Bean class, and I want to provide getter and setter methods for it. The setter will be setShowLabels, but should the getter be isShowingLabels, isShowLabels (that's really weird sounding), or setShowLabels?

Peter C
  • 6,219
  • 1
  • 25
  • 37

1 Answers1

9

It should be isShowLabels weird as that may sound, that's the convention. You could always rename the boolean to showingLabels.

Adam
  • 43,763
  • 16
  • 104
  • 144