• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JavaBean

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a simple question about Java Bean.

The following code has been taken from the following page:
http://en.wikipedia.org/wiki/JavaBean


Now my question is, if we have a getDeceased method such as

,

will I be breaking the JavaBean naming convention?

And secondly, is the Different syntax for a boolean field (is vs. get) only for boolean variables?



 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Swagato Bhatta wrote:
Now my question is, if we have a getDeceased method such as

,

will I be breaking the JavaBean naming convention?



Not really, but Java Bean design theory suggest to use isDeceased(), which is good and convey what it returns. Also this.Deceased; throws error.

Swagato Bhatta wrote:And secondly, is the Different syntax for a boolean field (is vs. get) only for boolean variables?


Yes.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic