In the previous example, the Person class defined properties name and age, of types String and int respectively. The properties were defined by the fact that the class defined methods getName, setName, getAge, and setAge.

This method for defining properties is outlined in detail in the JavaBeans specification. However, the basic rules are as follows:

It is important to pay attention to the capitalization, because property names are case-sensitive. For example, an entry Age=20 would not set the age property of the Person object.

 
loading table of contents...