
Java Beans is a specification for both using and building components. It does not alter the existing Java language. Beans are usually intended to work with a visual Rapid Application Development, RAD, tool.
Hello.java can be made into a Java Bean. We just add accessor methods to get and set the string.
public class HelloBean extends Hello{
public void setDrawStr(String newStr){
drawStr=newStr;
}
public String getDrawStr(){
return drawStr;
} }
//Note the use of inheritance.
After this file is compiled we can open it in a a RAD environment, such as Borland's JBuilder.

Bean properties can be examined and changed at design time (or run time) using the bean inspector shown at the top of this page. Beans are able to work in a RAD environment through the magic of Introspection and Persistence. It is possible to look inside a bean and discover its public methods, i.e., introspection. It is also possible for a bean to save its state to a stream, i.e., persistence.