Advertisements
Java Beans are components that can be used to assemble a larger Java application. Beans are classes that have properties, and can trigger events.
To define a property, a bean author provides accessor methods, that can get and set the value of a property. A bean tool should inspect the class for methods matching the get/set pattern, and allow you to modify the object's properties.
public class MyFirstBean
{
private String name;
public MyFirstBean()
{
name = new String("MyFirstBean");
}
public String getName()
{
return name;
}
public void setName( String newName )
{
name = newName;
}
}