A java bean is just a standard
- All properties private (use getters/setters)
- a public No argument constructor
- Implements serializable.
thats it; AFAIK just a convention. Lots of libs depend on it though....
edit -- http://en.wikipedia.org/wiki/JavaBean
edit edit -- this is beginning to sound like homework. From the API:
"Serializability of a class is enabled by the class implementing the java.io.Serializable interface. Classes that do not implement this interface will not have any of their state serialized or deserialized. All subtypes of a serializable class are themselves serializable. The serialization interface has no methods or fields and serves only to identify the semantics of being serializable."
In other words, serializable objects can be written to streams, and hence files, object dbs, anything really.
Also, there is no syntactic difference between a java bean and another class -- a class defines a java bean if it follows the standards.
There is a term for it because the standard allows libraries to programmatically do things with class instances you define in a predefined way. For example, if a library wants stream any object you pass into it, it knows it can because your object is serializable (assuming the lib requires your objects be proper java beans).