Bean Methods

Other than accessor methods, there is nothing special about a Java bean method. However, keep in mind that any public method is visible to users through application builders and other JavaBeans containers like the BeanBox. Only make methods public if you really do want them public. And when you do write a public method, give it a human readable name that makes it obvious for what the method should be used.

Get JavaBeans Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.