A Java bean is a Java class that has private member variables, public getter and setter methods, and a zero-argument, public constructor (supplied automatically by the compiler). To create a Java bean, follow these seven steps.
The Java bean has two properties,
lastName. A property is a private variable exposed to external programs by means of getter and setter methods.
The program will instantiate the Java bean and then call the setter and getter methods of the newly created Java bean.