Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>These initializations are done when the new instance of the class is created by JVM . See <a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.5" rel="nofollow">Creation of new class instances</a> section . It states:</p> <blockquote> <p>Whenever a new class instance is created, memory space is allocated for it with room for all the instance variables declared in the class type and all the instance variables declared in each superclass of the class type, including all the instance variables that may be hidden (§8.3).</p> <p>If there is not sufficient space available to allocate memory for the object, then creation of the class instance completes abruptly with an OutOfMemoryError. Otherwise, <strong>all the instance variables in the new object, including those declared in superclasses, are initialized to their default values</strong> (§4.12.5).</p> </blockquote> <p>The default value is as follows for each type of instance variable:</p> <blockquote> <ul> <li>For type <code>byte</code>, the default value is zero, that is, the value of <code>(byte)0</code>.</li> <li>For type <code>short</code>, the default value is zero, that is, the value of <code>(short)0</code>.</li> <li>For type <code>int</code>, the default value is zero, that is, <code>0</code>.</li> <li>For type <code>long</code>, the default value is zero, that is, <code>0L</code>.</li> <li>For type <code>float</code>, the default value is positive zero, that is, <code>0.0f</code>.</li> <li>For type <code>double</code>, the default value is positive zero, that is, <code>0.0d</code>.</li> <li>For type <code>char</code>, the default value is the null character, that is, <code>'\u0000'</code>.</li> <li>For type <code>boolean</code>, the default value is <code>false</code>.</li> <li>For all <code>reference types</code> (§4.3), the default value is <code>null</code>.</li> </ul> </blockquote>
    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. 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.
 

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