Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A JavaBean is just a <a href="http://www.oracle.com/technetwork/java/javase/documentation/spec-136004.html" rel="noreferrer">standard</a></p> <ol> <li>All properties private (use <a href="http://en.wikipedia.org/wiki/Mutator_method" rel="noreferrer">getters/setters</a>)</li> <li>A public <a href="http://en.wikipedia.org/wiki/Nullary_constructor" rel="noreferrer">no-argument constructor</a></li> <li>Implements <a href="http://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html" rel="noreferrer"><code>Serializable</code></a>.</li> </ol> <p>That's it. It's just a convention. Lots of libraries depend on it though.</p> <p>With respect to <code>Serializable</code>, from the <a href="http://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html" rel="noreferrer">API documentation</a>:</p> <blockquote> <p>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.</p> </blockquote> <p>In other words, serializable objects can be written to streams, and hence files, object databases, anything really. </p> <p>Also, there is no syntactic difference between a JavaBean and another class -- a class defines a JavaBean if it follows the standards.</p> <p>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 to stream any object you pass into it, it knows it can because your object is serializable (assuming the lib requires your objects be proper JavaBeans). </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload