Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There's a term for it to make it sound special. The reality is nowhere near so mysterious.</p> <p>Basically, a "Bean":</p> <ul> <li>is a serializable object (that is, it implements <a href="http://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html" rel="noreferrer"><code>java.io.Serializable</code></a>, and does so correctly), that</li> <li>has "properties" whose getters and setters are just methods with certain names (like, say, <code>getFoo()</code> is the getter for the "Foo" property), and </li> <li>has a public default constructor (so it can be created at will and configured by setting its properties).</li> </ul> <p>Update:</p> <p>As for <code>Serializable</code>: That is nothing but a "marker interface" (an interface that doesn't declare any functions) that tells Java that the implementing class consents to (and implies that it is capable of) "serialization" -- a process that converts an instance into a stream of bytes. Those bytes can be stored in files, sent over a network connection, etc, and have enough info to allow a JVM (at least, one that knows about the object's type) to reconstruct the object later -- possibly in a different instance of the application, or even on a whole other machine!</p> <p>Of course, in order to do that, the class has to abide by certain limitations. Chief among them is that all instance fields must be either primitive types (int, bool, etc), instances of some class that is also serializable, or marked as <code>transient</code> so that Java won't try to include them. (This of course means that <code>transient</code> fields will not survive the trip over a stream. A class that has <code>transient</code> fields should be prepared to reinitialize them if necessary.)</p> <p>A class that can not abide by those limitations should not implement <code>Serializable</code> (and, IIRC, the Java compiler won't even <em>let</em> it do so.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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