Java Bean

Java Beans are Java classes that follow the following rules:

  1. Implement the interface
  2. Have private properties with public getters and setters
  3. Have a public no-argument constructor

A simple Java Bean is implemented below:

public class ExampleBean implements { // private properties private String name; private Boolean programmer; // no-argument constructor public ExampleBean() { } // public getters and setters public String getName(){ return; } public void setName(String name){ = name; } public Boolean isProgrammer(){ return this.age; } public void setProgrammer(Boolean programmer){ this.programmer = programmer; } }

Java Beans, frequently refered as beans, are meant to be reusable software components that anyone can use without having to know and understand their inner implementation. They can be used by a bean editor in order to be customized and assemble an application.


  • standardized way that enforces reusability
  • customization with bean editors
  • persistence and ability to be transfered within network


  • lots of boilerplate with getters and setters
  • lack of immutability by design

More Information:

This article needs improvement. You can help improve this article. You can also write similar articles and help the community.